Class AccessControlContext
- java.lang.Object
-
- org.silverpeas.core.security.authorization.AccessControlContext
-
public class AccessControlContext extends Object
This class permits to define the context of access to a resource.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
get(String key, Class<T> classType)
Gets from context a value from a key that has been stored into the context instance.Set<AccessControlOperation>
getOperations()
Gets the operations performed into the context.static AccessControlContext
init()
Gets an initialized instance of access control context.AccessControlContext
onOperationsOf(AccessControlOperation... operations)
Defines the operations performed into the context.<T> AccessControlContext
put(String key, T value)
Puts into context a value linked to a key.
-
-
-
Method Detail
-
init
public static AccessControlContext init()
Gets an initialized instance of access control context.- Returns:
-
onOperationsOf
public AccessControlContext onOperationsOf(AccessControlOperation... operations)
Defines the operations performed into the context.- Parameters:
operations
-- Returns:
-
getOperations
public Set<AccessControlOperation> getOperations()
Gets the operations performed into the context.- Returns:
-
put
public <T> AccessControlContext put(String key, T value)
Puts into context a value linked to a key.- Type Parameters:
T
-- Parameters:
key
- the key.value
- the value.- Returns:
- the current instance.
-
get
public <T> T get(String key, Class<T> classType)
Gets from context a value from a key that has been stored into the context instance.- Type Parameters:
T
-- Parameters:
key
- the key associated to the searched value.classType
- the type of expected value.- Returns:
- the value if any, null if the expected type does not match with the one of the existing value.
-
-