...
The following code snippet returns all users with the same business roles as the current user:
paste-code-macro | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
if (api.user().loginName != "admin") { return Filter..... //as above } |
...