Skip to content

Instantly share code, notes, and snippets.

@leandrogualter
Created January 4, 2011 13:13
Show Gist options
  • Save leandrogualter/764747 to your computer and use it in GitHub Desktop.
Save leandrogualter/764747 to your computer and use it in GitHub Desktop.
<ISPECT>Vector userGroupMemberships = getGroupMemberships(getUser())</ISPECT>
<ISPECT>String userOid = object1.getOID()</ISPECT>
<!-- ADMIN MEMBERS -->
<ISPECT>TagObject adminGroup = getObject(getAttributeValue("ITS_adminGroup",teamRoot))</ISPECT>
<ISPECT>if(adminGroup != null)
<ISPECT>if(getType(adminGroup)=="group")
<ISPECT>Vector vAdmins = getMembers(adminGroup)</ISPECT>
<ISPECT>String isUserInList = "false"</ISPECT>
<ISPECT>Iterator itVAdmins = vAdmins.iterator()</ISPECT>
<ISPECT>while(itVAdmins.hasNext())
<ISPECT>TagObject adminGroupObj = (TagObject)itVAdmins.next()</ISPECT>
<ISPECT>if(isUserInList == "true")
<ISPECT>setLoopState(LOOP_BREAK)</ISPECT>
</ISPECT>
<ISPECT>Iterator itUserGroup = userGroupMemberships.iterator()</ISPECT>
<ISPECT>while(itUserGroup.hasNext())
<ISPECT>TagObject userGroupObj = (TagObject)itUserGroup.next()</ISPECT>
<ISPECT>if(userGroupObj.getOID() == adminGroupObj.getOID())
<ISPECT>isUserInList = "true"</ISPECT>
<ISPECT>setLoopState(LOOP_BREAK)</ISPECT>
</ISPECT>
<ISPECT>if(userOid == adminGroupObj.getOID())
<ISPECT>isUserInList = "true"</ISPECT>
<ISPECT>setLoopState(LOOP_BREAK)</ISPECT>
</ISPECT>
</ISPECT>
</ISPECT>
</ISPECT>
</ISPECT>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment