Esempio n. 1
0
 /**
  * Find out if this user is associated with the group in an organisation which is within the
  * membership group
  *
  * @param groupName
  * @param org
  * @return
  */
 public boolean isInGroup(String groupName, Organisation org) {
   if (getMemberships() != null) {
     for (GroupMembership m : getMemberships()) {
       if (m.getGroupEntity().getName().equals(groupName)) {
         if (org.isWithin(m.getWithinOrg())) {
           return true;
         }
       }
     }
   }
   return false;
 }
Esempio n. 2
0
 public boolean hasRole(String roleName, Organisation org) {
   if (getMemberships() != null) {
     for (GroupMembership m : getMemberships()) {
       if (org.isWithin(m.getWithinOrg())) {
         for (GroupRole r : m.getGroupEntity().getGroupRoles()) {
           if (r.getRoleName().equals(roleName)) {
             return true;
           }
         }
       }
     }
   }
   return false;
 }