Skip to content

Commit f0ee77b

Browse files
committed
removed location bookmark action out of CAS
1 parent 7b15793 commit f0ee77b

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

grails-app/conf/application.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ app:
5858
security:
5959
cas:
6060
casProperties: "casServerLoginUrl,serverName,centralServer,casServerName,uriFilterPattern,uriExclusionFilter,uriExclusionFilterPattern,casServerLoginUrlPrefix,gateway,casServerUrlPrefix,contextPath,gatewayStorageClass"
61-
uriExclusionFilterPattern: "/assets/.*,/images.*,/css.*,/js.*,/less.*,/ajax/bulkLookupQuestions,/uploads/.*"
61+
uriExclusionFilterPattern: "/assets/.*,/images.*,/css.*,/js.*,/less.*,/ajax/(bulkLookupQuestions|saveBookmarkLocation|getBookmarkLocations),/uploads/.*"
6262
authenticateOnlyIfLoggedInPattern: ".*"
6363
uriFilterPattern: ".*/user/.*,.*/site/(?!(index|list|elasticsearch|getImages|getPoiImages|ajaxUpdate|checkSiteName|ajaxList|checkPointInsideProjectAreaAndAddress)).*,.*/project/(?!(index|search|citizenScience|listRecordImages|projectSummaryReportCallback)).*,.*/activity/(?!index).*,.*/output/(?!index).*,.*/image/(?!index).*,.*/admin/.*,i.*/proxy/speciesListPost,.*/proxy/documentUpdate,.*/proxy/deleteDocument,.*/home/advanced,.*/organisation/(?!index).*,.*/organisation/(?!list).*,.*/bioActivity/create/.*,.*/bioActivity/edit/.*,.*/bioActivity/list,/sight/.*"
6464
readOnlyOfficerRole: "ROLE_FC_READ_ONLY"

grails-app/controllers/au/org/ala/biocollect/merit/AjaxController.groovy

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import org.grails.web.json.JSONObject
55

66
class AjaxController {
77

8-
def authService
98
def locationService
9+
def userInfoService
1010

1111
/**
1212
* Simple action that can be called by long running pages periodically to keep the container session alive.
@@ -18,7 +18,7 @@ class AjaxController {
1818
}
1919

2020
def getBookmarkLocations() {
21-
def userId = authService.userId
21+
def userId = userInfoService.getCurrentUser()?.userId
2222
def result = locationService.getBookmarkLocationsForUser(userId)
2323

2424
if (result.hasProperty("error")) {
@@ -29,7 +29,7 @@ class AjaxController {
2929
}
3030

3131
def saveBookmarkLocation() {
32-
def userId = authService.userId
32+
def userId = userInfoService.getCurrentUser()?.userId
3333
JSONObject bookmark = request.JSON
3434
bookmark.put("userId", userId)
3535
log.debug "post json = ${request.JSON}"

grails-app/views/layouts/mobile.gsp

+9-11
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@
3333
<g:layoutBody/>
3434
</div>
3535

36-
<asset:script type="text/javascript">
37-
$(function() {
38-
$.ajaxSetup({
39-
cache: false,
40-
xhrFields: {
41-
withCredentials: true
42-
},
43-
beforeSend: function(xhr){
44-
xhr.setRequestHeader('authKey', "${authKey}");
36+
<script type="text/javascript">
37+
$.ajaxSetup({
38+
cache: false,
39+
xhrFields: {
40+
withCredentials: true
41+
},
42+
beforeSend: function(xhr){
43+
xhr.setRequestHeader('authKey', "${authKey}");
4544
xhr.setRequestHeader('userName', "${userName}");
4645
}
47-
});
4846
});
49-
</asset:script>
47+
</script>
5048
<asset:deferredScripts/>
5149
</body>
5250
</html>

0 commit comments

Comments
 (0)