Skip to content
Permalink
Browse files

Add add-ref-groups script

  • Loading branch information
mederly committed Mar 26, 2019
1 parent 7f20946 commit 053a5ecf12d2597869919b1944e7485776639ef3
Showing with 25 additions and 0 deletions.
  1. +23 −0 demo/complex/add-ref-groups.gsh
  2. +2 −0 demo/complex/add-ref-groups.sh
@@ -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'))

@@ -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.
You can’t perform that action at this time.