Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
midPoint_container/demo/grouper/add-ref-groups.gsh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The "supergroup" is now obsolete and was removed. It temporarily stays as a parameter for Grouper connector but we can specify any existing group there, as it is used solely for the "test resource" operation.
21 lines (18 sloc)
663 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def addGroups(gs,stem,owner,regexp) { | |
for (group in stem.childGroups) { | |
if (!group.name.endsWith('_includes') && | |
!group.name.endsWith('_excludes') && | |
!group.name.endsWith('_systemOfRecord') && | |
!group.name.endsWith('_systemOfRecordAndIncludes') && | |
(regexp == null || group.extension ==~ regexp)) { | |
println 'Adding: ' + group | |
def s = SubjectFinder.findById(group.getId(), 'group', 'g:gsa') | |
owner.addMember(s, false) | |
} else { | |
println 'Ignoring: ' + group | |
} | |
} | |
} | |
gs = GrouperSession.startRootSession() | |
def cs = GroupFinder.findByName(gs, "app:cs", true) | |
addGroups(gs, StemFinder.findByName(gs, 'ref:course'), cs, /CS.*/) |