Skip to content

Commit 983c628

Browse files
committed
Merge branch 'release/6.1.3'
2 parents df28c9e + 423053a commit 983c628

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ plugins {
2525
id "com.virgo47.ClasspathJar" version "1.0.0"
2626
}
2727

28-
version "6.1.2"
28+
version "6.1.3"
2929
group "au.org.ala"
3030
description "Digivol application"
3131

grails-app/controllers/au/org/ala/volunteer/AjaxController.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class AjaxController {
7777

7878
projectTypes.each {
7979
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
8181
}
8282

8383
stats.volunteerCount = userService.countActiveUsers()

grails-app/init/au/org/ala/volunteer/BootStrap.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ class BootStrap {
5858

5959
fullTextIndexService.ping()
6060

61-
initProjectSize()
6261
}
6362

6463
/**
6564
* This is to initialise the project sizes for release 6.1.0.
6665
* Disable this in next release.
66+
* DEPRECATED
6767
*/
6868
private void initProjectSize() {
6969
log.info("Initialising project sizes...")

grails-app/services/au/org/ala/volunteer/UserService.groovy

+11-2
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,19 @@ class UserService {
370370
serviceResults = authService.getUserDetailsById([user.userId], true)
371371
def userFromService = serviceResults?.users?.get(user.userId)
372372
def userRoles = user.userRoles
373+
log.debug("userRoles: ${userRoles}")
373374
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+
}
375383
log.debug("[hasCasRole]: ALA service roles: ${currentRoles}")
376-
//log.debug("${currentRoles?.intersect([role])?.isEmpty()}")
384+
if (!currentRoles) return false
385+
377386
log.debug("[hasCasRole]: role check: [${!currentRoles?.intersect([role])?.isEmpty()}]")
378387
return !currentRoles?.intersect([role])?.isEmpty()
379388
} catch (Exception e) {

0 commit comments

Comments
 (0)