Package org.silverpeas.core.security
Class SecurableRequestCache
- java.lang.Object
-
- org.silverpeas.core.security.SecurableRequestCache
-
public class SecurableRequestCache extends Object
A common tool to handled securable implementation with a request cache.Indeed, the computing about secured access can be costly about performances and using a request cache could be interesting when access authorization is computed several times for a same entity into the context of a same request.
- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canBeAccessedBy(User user, String uniqueIdentifier, Predicate<User> canBeAccessedBy)
Indicates if the given user can access the data managed by the object instance.static boolean
canBeDeletedBy(User user, String uniqueIdentifier, Predicate<User> canBeDeletedBy)
Indicates if the given user can delete the data managed by the object instance.static boolean
canBeModifiedBy(User user, String uniqueIdentifier, Predicate<User> canBeModifiedBy)
Indicates if the given user can modify the data managed by the object instance.static void
clear(String uniqueIdentifier)
Clears the cache linked to an entity represented by the given unique identifier.
-
-
-
Method Detail
-
canBeAccessedBy
public static boolean canBeAccessedBy(User user, String uniqueIdentifier, Predicate<User> canBeAccessedBy)
Indicates if the given user can access the data managed by the object instance.- Parameters:
user
- a user in Silverpeas.uniqueIdentifier
- a unique identifier.canBeAccessedBy
- the supplier of the result of access authorization computing.- Returns:
- true if the user can access the data managed by this instance, false otherwise.
-
canBeModifiedBy
public static boolean canBeModifiedBy(User user, String uniqueIdentifier, Predicate<User> canBeModifiedBy)
Indicates if the given user can modify the data managed by the object instance.- Parameters:
user
- a user in Silverpeas.uniqueIdentifier
- a unique identifier.canBeModifiedBy
- the supplier of the result of access authorization computing.- Returns:
- true if the user can modify the data managed by this instance, false otherwise.
-
canBeDeletedBy
public static boolean canBeDeletedBy(User user, String uniqueIdentifier, Predicate<User> canBeDeletedBy)
Indicates if the given user can delete the data managed by the object instance.- Parameters:
user
- a user in Silverpeas.uniqueIdentifier
- a unique identifier.canBeDeletedBy
- the supplier of the result of access authorization computing.- Returns:
- true if the user can delete the data managed by this instance, false otherwise.
-
clear
public static void clear(String uniqueIdentifier)
Clears the cache linked to an entity represented by the given unique identifier.- Parameters:
uniqueIdentifier
- an identifier which represents a unique entity.
-
-