Class TodoComponentAuthorization
- java.lang.Object
-
- org.silverpeas.core.personalorganizer.service.TodoComponentAuthorization
-
- All Implemented Interfaces:
ComponentAuthorization
@Service public class TodoComponentAuthorization extends Object implements ComponentAuthorization
Processor of authorization to access a given personal user task. Usually a task is always related to a given user (the owner) and it shouldn't be accessed or saw by another user unless he's also involved in this task.- Author:
- mmoquillon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.security.authorization.ComponentAuthorization
ComponentAuthorization.ComponentResourceReference
-
-
Constructor Summary
Constructors Constructor Description TodoComponentAuthorization()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Stream<T>
filter(Collection<T> resources, Function<T,ComponentAuthorization.ComponentResourceReference> converter, String userId, AccessControlOperation... operations)
Filtering the given resources from user rights.boolean
isRelatedTo(String instanceId)
Is this service related to the specified component instance.
-
-
-
Method Detail
-
isRelatedTo
public boolean isRelatedTo(String instanceId)
Description copied from interface:ComponentAuthorization
Is this service related to the specified component instance. The service is related to the specified instance if it is a service defined by the application from which the instance was spawned.- Specified by:
isRelatedTo
in interfaceComponentAuthorization
- Parameters:
instanceId
- the unique instance identifier of the component.- Returns:
- true if the instance is spawn from the application to which the service is related. False otherwise.
-
filter
public <T> Stream<T> filter(Collection<T> resources, Function<T,ComponentAuthorization.ComponentResourceReference> converter, String userId, AccessControlOperation... operations)
Description copied from interface:ComponentAuthorization
Filtering the given resources from user rights.The order into which the given resources are provided is kept.
- Specified by:
filter
in interfaceComponentAuthorization
- Type Parameters:
T
- the type of a resource contained into resource list.- Parameters:
resources
- the resources to filter.converter
- the converter which permits to get theComponentAuthorization.ComponentResourceReference
instance from aT
resource.userId
- the identifier of the user.operations
- the operations to give to AccessControlContext.- Returns:
- a filtered stream of
T
resource, ordered as the given resources are.
-
-