File tree 4 files changed +14
-5
lines changed
controllers/au/org/ala/volunteer
init/au/org/ala/volunteer
services/au/org/ala/volunteer
4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ plugins {
25
25
id " com.virgo47.ClasspathJar" version " 1.0.0"
26
26
}
27
27
28
- version " 6.1.2 "
28
+ version " 6.1.3 "
29
29
group " au.org.ala"
30
30
description " Digivol application"
31
31
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ class AjaxController {
77
77
78
78
projectTypes. each {
79
79
def projects = Project . findAllByProjectType(it)
80
- stats[it. description ?: it. name] = Task . countByProjectInList(projects)
80
+ stats[it. description ?: it. name] = (projects . size() > 0 ) ? Task . countByProjectInList(projects) : 0
81
81
}
82
82
83
83
stats. volunteerCount = userService. countActiveUsers()
Original file line number Diff line number Diff line change @@ -58,12 +58,12 @@ class BootStrap {
58
58
59
59
fullTextIndexService. ping()
60
60
61
- initProjectSize()
62
61
}
63
62
64
63
/**
65
64
* This is to initialise the project sizes for release 6.1.0.
66
65
* Disable this in next release.
66
+ * DEPRECATED
67
67
*/
68
68
private void initProjectSize () {
69
69
log. info(" Initialising project sizes..." )
Original file line number Diff line number Diff line change @@ -370,10 +370,19 @@ class UserService {
370
370
serviceResults = authService. getUserDetailsById([user. userId], true )
371
371
def userFromService = serviceResults?. users?. get(user. userId)
372
372
def userRoles = user. userRoles
373
+ log. debug(" userRoles: ${ userRoles} " )
373
374
def roleObjs = userRoles* . role
374
- def currentRoles = (roleObjs* . name + userFromService?. roles). toSet()
375
+ log. debug(" roleObjs: ${ roleObjs} " )
376
+ def currentRoles
377
+ if (roleObjs) {
378
+ log. debug(" role names: ${ roleObjs*.name} " )
379
+ currentRoles = (roleObjs* . name + userFromService?. roles). toSet()
380
+ } else {
381
+ currentRoles = userFromService?. roles
382
+ }
375
383
log. debug(" [hasCasRole]: ALA service roles: ${ currentRoles} " )
376
- // log.debug("${currentRoles?.intersect([role])?.isEmpty()}")
384
+ if (! currentRoles) return false
385
+
377
386
log. debug(" [hasCasRole]: role check: [${ !currentRoles?.intersect([role])?.isEmpty()} ]" )
378
387
return ! currentRoles?. intersect([role])?. isEmpty()
379
388
} catch (Exception e) {
You can’t perform that action at this time.
0 commit comments