Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add add-ref-groups script
mederly committed Mar 26, 2019
1 parent 7f20946 commit 053a5ec
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions demo/complex/add-ref-groups.gsh
@@ -0,0 +1,23 @@

def addGroups(gs,stem) {
def supergroup = GroupFinder.findByName(gs, "etc:midpointGroups", true)
for (group in stem.childGroups) {
if (!group.name.endsWith('_includes') &&
!group.name.endsWith('_excludes') &&
!group.name.endsWith('_systemOfRecord') &&
!group.name.endsWith('_systemOfRecordAndIncludes')) {
println 'Adding: ' + group
def s = SubjectFinder.findById(group.getId(), 'group', 'g:gsa')
supergroup.addMember(s, false)
} else {
println 'Ignoring: ' + group
}
}
}

gs = GrouperSession.startRootSession()

addGroups(gs, StemFinder.findByName(gs, 'ref:affiliation'))
addGroups(gs, StemFinder.findByName(gs, 'ref:dept'))
addGroups(gs, StemFinder.findByName(gs, 'ref:course'))

2 changes: 2 additions & 0 deletions demo/complex/add-ref-groups.sh
@@ -0,0 +1,2 @@
docker cp add-ref-groups.gsh complex_grouper_daemon_1:/tmp/
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/add-ref-groups.gsh"

0 comments on commit 053a5ec

Please sign in to comment.