Skip to content

Commit

Permalink
Merge branch 'release/6.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
cdausmus committed Jun 15, 2022
2 parents df28c9e + 423053a commit 983c628
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
id "com.virgo47.ClasspathJar" version "1.0.0"
}

version "6.1.2"
version "6.1.3"
group "au.org.ala"
description "Digivol application"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class AjaxController {

projectTypes.each {
def projects = Project.findAllByProjectType(it)
stats[it.description ?: it.name] = Task.countByProjectInList(projects)
stats[it.description ?: it.name] = (projects.size() > 0) ? Task.countByProjectInList(projects) : 0
}

stats.volunteerCount = userService.countActiveUsers()
Expand Down
2 changes: 1 addition & 1 deletion grails-app/init/au/org/ala/volunteer/BootStrap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ class BootStrap {

fullTextIndexService.ping()

initProjectSize()
}

/**
* This is to initialise the project sizes for release 6.1.0.
* Disable this in next release.
* DEPRECATED
*/
private void initProjectSize() {
log.info("Initialising project sizes...")
Expand Down
13 changes: 11 additions & 2 deletions grails-app/services/au/org/ala/volunteer/UserService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,19 @@ class UserService {
serviceResults = authService.getUserDetailsById([user.userId], true)
def userFromService = serviceResults?.users?.get(user.userId)
def userRoles = user.userRoles
log.debug("userRoles: ${userRoles}")
def roleObjs = userRoles*.role
def currentRoles = (roleObjs*.name + userFromService?.roles).toSet()
log.debug("roleObjs: ${roleObjs}")
def currentRoles
if (roleObjs) {
log.debug("role names: ${roleObjs*.name}")
currentRoles = (roleObjs*.name + userFromService?.roles).toSet()
} else {
currentRoles = userFromService?.roles
}
log.debug("[hasCasRole]: ALA service roles: ${currentRoles}")
//log.debug("${currentRoles?.intersect([role])?.isEmpty()}")
if (!currentRoles) return false

log.debug("[hasCasRole]: role check: [${!currentRoles?.intersect([role])?.isEmpty()}]")
return !currentRoles?.intersect([role])?.isEmpty()
} catch (Exception e) {
Expand Down

0 comments on commit 983c628

Please sign in to comment.