com.silverpeas.web.mock
Class AccessControllerMock

java.lang.Object
  extended by com.silverpeas.accesscontrol.AbstractAccessController<String>
      extended by com.silverpeas.web.mock.AccessControllerMock
All Implemented Interfaces:
AccessController<String>

@Named(value="componentAccessController")
public class AccessControllerMock
extends AbstractAccessController<String>

A mock of an user access controller for testing purpose.


Constructor Summary
AccessControllerMock()
           
 
Method Summary
 boolean isUserAuthorized(String userId, String object, AccessControlContext context)
          Checks if the specified user may access the specified object.
 void setAuthorization(boolean isUsersAuthorized)
           
 
Methods inherited from class com.silverpeas.accesscontrol.AbstractAccessController
fillUserRoles, getUserRoles, isUserAuthorized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessControllerMock

public AccessControllerMock()
Method Detail

setAuthorization

public void setAuthorization(boolean isUsersAuthorized)

isUserAuthorized

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

Parameters:
userId - the unique identifier of the user.
object - the object to be accessed.
context - the context in which the object is accessed.
Returns:
true if access is granted - false otherwise.


Copyright © 2016 Silverpeas. All Rights Reserved.