Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 The following code snippet returns all users with the same business roles as the current user:

paste-code-macro
languagegroovy
def myBizRoleNames = api.user()?.businessRoles*.uniqueName
if (myBizRoleNames == null) myBizRoleNames = []
//if (!myBizRoleNames) {
  //what to do when there are no bizRoleDefined?
//}
return Filter.and(*myBizRoleNames.collect {
  Filter.some("businessRoles", Filter.equal("uniqueName", it))
})

The following IF statement excludes defined users:

paste-code-macro
languagegroovy
if (api.user().loginName != "admin") {
  return Filter..... //as above
}

...