com.silverpeas.accesscontrol
Class AbstractAccessController<T>

java.lang.Object
  extended by com.silverpeas.accesscontrol.AbstractAccessController<T>
All Implemented Interfaces:
AccessController<T>
Direct Known Subclasses:
AccessControllerMock, AttachmentAccessController, ComponentAccessController, DocumentAccessController, NodeAccessController, PublicationAccessController, SimpleDocumentAccessController, SimpleDocumentAccessControllerMock, SpaceAccessController, SpaceAccessControllerMock, WorkspaceAccessController

public abstract class AbstractAccessController<T>
extends Object
implements AccessController<T>

User: Yohann Chastagnier Date: 30/12/13


Constructor Summary
AbstractAccessController()
           
 
Method Summary
protected  void fillUserRoles(Set<SilverpeasRole> userRoles, AccessControlContext context, String userId, T object)
          This method must fill user roles into the given container by taking in account the other parameters.
 Set<SilverpeasRole> getUserRoles(AccessControlContext context, String userId, T object)
          Gets the user roles about the aimed object and by taking in account the context of the access.
 boolean isUserAuthorized(String userId, T object)
          Checks if the specified user may access the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.silverpeas.accesscontrol.AccessController
isUserAuthorized
 

Constructor Detail

AbstractAccessController

public AbstractAccessController()
Method Detail

isUserAuthorized

public final boolean isUserAuthorized(String userId,
                                      T object)
Description copied from interface: AccessController
Checks if the specified user may access the specified object.

Specified by:
isUserAuthorized in interface AccessController<T>
Parameters:
userId - the unique identifier of the user.
object - the object to be accessed.
Returns:
true if access is granted - false otherwise.

getUserRoles

public Set<SilverpeasRole> getUserRoles(AccessControlContext context,
                                        String userId,
                                        T object)
Gets the user roles about the aimed object and by taking in account the context of the access. After a first call, user role are cached (REQUEST live time) in order to increase the performances in case of several call on the same user and object.

Parameters:
context -
userId -
object -
Returns:

fillUserRoles

protected void fillUserRoles(Set<SilverpeasRole> userRoles,
                             AccessControlContext context,
                             String userId,
                             T object)
This method must fill user roles into the given container by taking in account the other parameters.

Parameters:
userRoles -
context -
userId -
object -


Copyright © 2016 Silverpeas. All Rights Reserved.