Exemplo n.º 1
0
  public Set<AbstractResource> getRoleParticipantsWithCapability(String rid, String cid) {
    Set<AbstractResource> resourceSet = new HashSet<AbstractResource>();
    Role role = getRole(rid);
    if (role != null) {

      // filter role members by capability
      if (cid != null) {
        Capability cap = getCapability(cid);
        if (cap != null) {
          for (AbstractResource member : role.getResources()) {
            if (((Participant) member).getCapabilities().contains(cap)) {
              resourceSet.add(member);
            }
          }
        }
      } else resourceSet = role.getResources(); // no cid means don't filter
    }
    return resourceSet;
  }
Exemplo n.º 2
0
 public Set<Participant> getParticipantsInDescendantRoles(Role owner) {
   Set<Participant> result = new HashSet<Participant>();
   Set<Role> roleSet = getRoles();
   for (Role role : roleSet) {
     if (role.ultimatelyBelongsTo(owner)) {
       result.addAll(castToParticipantSet(role.getResources()));
     }
   }
   return result;
 }
Exemplo n.º 3
0
 public Set<Participant> getRoleParticipants(String rid) {
   Role r = roleMap.get(rid);
   return (r != null) ? castToParticipantSet(r.getResources()) : null;
 }