Пример #1
0
 public Iterator getRoles(String username) {
   CachedAcl acl = (CachedAcl) acls.get(username);
   if (null != acl) {
     return acl.getRoles();
   }
   return null;
 }
Пример #2
0
 public Role getRole(String username, String roleName, String groupName) {
   CachedAcl acl = (CachedAcl) acls.get(username);
   if (acl == null) {
     return null;
   }
   return acl.getRole(roleName, groupName);
 }
Пример #3
0
 public boolean hasRole(String username, String roleName, String groupName) {
   CachedAcl acl = (CachedAcl) acls.get(username);
   if (null != acl) {
     return acl.hasRole(roleName, groupName);
   }
   return false;
 }
Пример #4
0
 /*
  * Load the security cache for the given user's roles and permissions.
  *
  * @param JetspeedUser the user to cache all role and permission information for.
  */
 public void load(String username) throws JetspeedSecurityException {
   CachedAcl acl = new CachedAcl(username);
   acl.setRoles(JetspeedSecurity.getRoles(username));
   acls.put(username, acl);
   if (perms.size() == 0) {
     loadRolePermissions();
   }
 }
Пример #5
0
 public void removeAllRoles(String rolename) {
   Iterator iterator = acls.values().iterator();
   while (iterator.hasNext()) {
     CachedAcl acl = (CachedAcl) iterator.next();
     acl.removeRole(rolename);
   }
   perms.remove(rolename);
 }
Пример #6
0
 public void removeRole(String username, String roleName, String groupName) {
   CachedAcl acl = (CachedAcl) acls.get(username);
   if (null != acl) {
     acl.removeRole(roleName, groupName);
   }
   // TODO: Why do this?
   perms.remove(roleName);
 }
Пример #7
0
 public void addRole(String username, Role role, Group group) {
   CachedAcl acl = (CachedAcl) acls.get(username);
   if (null != acl) {
     acl.addRole(role, group);
   }
   if (!perms.containsKey(role.getName())) {
     perms.put(role.getName(), new HashMap());
   }
 }