Interface ComponentAuthorization
-
- All Known Implementing Classes:
TodoComponentAuthorization
public interface ComponentAuthorization
Component security provides a way to check a user have enough rights to access a given object in a Silverpeas component instance. Each Silverpeas component should implements this interface according to the objects or resources it manages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ComponentAuthorization.ComponentResourceReference
Representation of a resource in order to be filtered by the API implementations.
-
Method Summary
All Methods Static Methods Instance Methods Abstract 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.static Set<ComponentAuthorization>
getAll()
boolean
isRelatedTo(String instanceId)
Is this service related to the specified component instance.
-
-
-
Method Detail
-
getAll
static Set<ComponentAuthorization> getAll()
-
isRelatedTo
boolean isRelatedTo(String instanceId)
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.- 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
<T> Stream<T> filter(Collection<T> resources, Function<T,ComponentAuthorization.ComponentResourceReference> converter, String userId, AccessControlOperation... operations)
Filtering the given resources from user rights.The order into which the given resources are provided is kept.
- 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.
-
-