org.apache.jetspeed.security.impl
Class RoleManagerImpl

java.lang.Object
  extended by org.apache.jetspeed.security.impl.RoleManagerImpl
All Implemented Interfaces:
org.apache.jetspeed.security.RoleManager

public class RoleManagerImpl
extends Object
implements org.apache.jetspeed.security.RoleManager

Implementation for managing roles.

Role hierarchy elements are being returned as a Rolecollection. The backing implementation must appropriately map the role hierarchy to a preferences sub-tree.

The convention {principal}.{subprincipal} has been chosen to name roles hierachies in order to support declarative security. Implementation follow the conventions enforced by the PreferencesAPI.

Author:
David Le Strat , David Sean Taylor

Field Summary
private  org.apache.jetspeed.security.AuthenticationProviderProxy atnProviderProxy
          The authentication provider proxy.
private static org.apache.commons.logging.Log log
          The logger.
private  org.apache.jetspeed.security.spi.RoleSecurityHandler roleSecurityHandler
          The role security handler.
private  org.apache.jetspeed.security.spi.SecurityMappingHandler securityMappingHandler
          The security mapping handler.
 
Constructor Summary
RoleManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider)
           
 
Method Summary
 void addRole(String roleFullPathName)
           
 void addRoleToGroup(String roleFullPathName, String groupFullPathName)
           
 void addRoleToUser(String username, String roleFullPathName)
           
 org.apache.jetspeed.security.Role getRole(String roleFullPathName)
           
 Iterator getRoles(String filter)
           
 Collection getRolesForUser(String username)
           
 Collection getRolesInGroup(String groupFullPathName)
           
 boolean isGroupInRole(String groupFullPathName, String roleFullPathName)
           
 boolean isUserInRole(String username, String roleFullPathName)
           
 void removeRole(String roleFullPathName)
           
 void removeRoleFromGroup(String roleFullPathName, String groupFullPathName)
           
 void removeRoleFromUser(String username, String roleFullPathName)
           
 boolean roleExists(String roleFullPathName)
           
 void setRoleEnabled(String roleFullPathName, boolean enabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The logger.


atnProviderProxy

private org.apache.jetspeed.security.AuthenticationProviderProxy atnProviderProxy
The authentication provider proxy.


roleSecurityHandler

private org.apache.jetspeed.security.spi.RoleSecurityHandler roleSecurityHandler
The role security handler.


securityMappingHandler

private org.apache.jetspeed.security.spi.SecurityMappingHandler securityMappingHandler
The security mapping handler.

Constructor Detail

RoleManagerImpl

public RoleManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider)
Parameters:
securityProvider - The security provider.
Method Detail

addRole

public void addRole(String roleFullPathName)
             throws org.apache.jetspeed.security.SecurityException
Specified by:
addRole in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.addRole(java.lang.String)

removeRole

public void removeRole(String roleFullPathName)
                throws org.apache.jetspeed.security.SecurityException
Specified by:
removeRole in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.removeRole(java.lang.String)

roleExists

public boolean roleExists(String roleFullPathName)
Specified by:
roleExists in interface org.apache.jetspeed.security.RoleManager
See Also:
RoleManager.roleExists(java.lang.String)

getRole

public org.apache.jetspeed.security.Role getRole(String roleFullPathName)
                                          throws org.apache.jetspeed.security.SecurityException
Specified by:
getRole in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.getRole(java.lang.String)

getRolesForUser

public Collection getRolesForUser(String username)
                           throws org.apache.jetspeed.security.SecurityException
Specified by:
getRolesForUser in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.getRolesForUser(java.lang.String)

getRolesInGroup

public Collection getRolesInGroup(String groupFullPathName)
                           throws org.apache.jetspeed.security.SecurityException
Specified by:
getRolesInGroup in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.getRolesInGroup(java.lang.String)

addRoleToUser

public void addRoleToUser(String username,
                          String roleFullPathName)
                   throws org.apache.jetspeed.security.SecurityException
Specified by:
addRoleToUser in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.addRoleToUser(java.lang.String, java.lang.String)

removeRoleFromUser

public void removeRoleFromUser(String username,
                               String roleFullPathName)
                        throws org.apache.jetspeed.security.SecurityException
Specified by:
removeRoleFromUser in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.removeRoleFromUser(java.lang.String, java.lang.String)

isUserInRole

public boolean isUserInRole(String username,
                            String roleFullPathName)
                     throws org.apache.jetspeed.security.SecurityException
Specified by:
isUserInRole in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.isUserInRole(java.lang.String, java.lang.String)

addRoleToGroup

public void addRoleToGroup(String roleFullPathName,
                           String groupFullPathName)
                    throws org.apache.jetspeed.security.SecurityException
Specified by:
addRoleToGroup in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.addRoleToGroup(java.lang.String, java.lang.String)

removeRoleFromGroup

public void removeRoleFromGroup(String roleFullPathName,
                                String groupFullPathName)
                         throws org.apache.jetspeed.security.SecurityException
Specified by:
removeRoleFromGroup in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.removeRoleFromGroup(java.lang.String, java.lang.String)

isGroupInRole

public boolean isGroupInRole(String groupFullPathName,
                             String roleFullPathName)
                      throws org.apache.jetspeed.security.SecurityException
Specified by:
isGroupInRole in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.isGroupInRole(java.lang.String, java.lang.String)

getRoles

public Iterator getRoles(String filter)
                  throws org.apache.jetspeed.security.SecurityException
Specified by:
getRoles in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.getRoles(java.lang.String)

setRoleEnabled

public void setRoleEnabled(String roleFullPathName,
                           boolean enabled)
                    throws org.apache.jetspeed.security.SecurityException
Specified by:
setRoleEnabled in interface org.apache.jetspeed.security.RoleManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
RoleManager.setRoleEnabled(java.lang.String, boolean)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.