public Iterator getRoles(String username) { CachedAcl acl = (CachedAcl) acls.get(username); if (null != acl) { return acl.getRoles(); } return null; }
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); }
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; }
/* * 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(); } }
public void removeAllRoles(String rolename) { Iterator iterator = acls.values().iterator(); while (iterator.hasNext()) { CachedAcl acl = (CachedAcl) iterator.next(); acl.removeRole(rolename); } perms.remove(rolename); }
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); }
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()); } }