Class SpaceAccessController
- java.lang.Object
-
- org.silverpeas.core.security.authorization.AbstractAccessController<String>
-
- org.silverpeas.core.security.authorization.SpaceAccessController
-
- All Implemented Interfaces:
AccessController<String>
,SpaceAccessControl
@Service @Singleton public class SpaceAccessController extends AbstractAccessController<String> implements SpaceAccessControl
Check the access to a space for a user.- Author:
- Yohann Chastagnier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpaceAccessController.DataManager
Data manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fillUserRoles(Set<SilverpeasRole> userRoles, AccessControlContext context, String userId, String spaceId)
Fills in the specified set the roles the user plays for the given resource in Silverpeas according to the specified access context.Stream<String>
filterAuthorizedByUser(Collection<String> spaceIds, String userId, AccessControlContext context)
Filters the given object list in order to keep those the specified user is authorized on.boolean
hasUserSpaceManagementAuthorization(String userId, String spaceId, AccessControlContext context)
Checks if the specified user may manage the specified space represented by its identifier.boolean
isUserAuthorized(String userId, String spaceId, AccessControlContext context)
Checks if the specified user may access the specified object.-
Methods inherited from class org.silverpeas.core.security.authorization.AbstractAccessController
filterAuthorizedByUser, getUserRoles, isUserAuthorized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.security.authorization.AccessController
filterAuthorizedByUser, getUserRoles, isGroupAuthorized, isUserAuthorized, isUserAuthorized
-
Methods inherited from interface org.silverpeas.core.security.authorization.SpaceAccessControl
hasUserSpaceManagementAuthorization, isUserAuthorized
-
-
-
-
Method Detail
-
isUserAuthorized
public boolean isUserAuthorized(String userId, String spaceId, AccessControlContext context)
Description copied from interface:AccessController
Checks if the specified user may access the specified object.- Specified by:
isUserAuthorized
in interfaceAccessController<String>
- Parameters:
userId
- the unique identifier of the user.spaceId
- the object to be accessed.context
- the context in which the object is accessed.- Returns:
- true if access is granted - false otherwise.
-
filterAuthorizedByUser
public Stream<String> filterAuthorizedByUser(Collection<String> spaceIds, String userId, AccessControlContext context)
Description copied from interface:AccessController
Filters the given object list in order to keep those the specified user is authorized on.This aim of this method is to be as efficient as possible on large volume of data.
- Specified by:
filterAuthorizedByUser
in interfaceAccessController<String>
- Overrides:
filterAuthorizedByUser
in classAbstractAccessController<String>
- Parameters:
spaceIds
- the objects to filter.userId
- the unique identifier of the user.context
- the context in which the object is accessed.- Returns:
- true if access is granted - false otherwise.
-
fillUserRoles
protected void fillUserRoles(Set<SilverpeasRole> userRoles, AccessControlContext context, String userId, String spaceId)
Description copied from class:AbstractAccessController
Fills in the specified set the roles the user plays for the given resource in Silverpeas according to the specified access context.- Overrides:
fillUserRoles
in classAbstractAccessController<String>
- Parameters:
userRoles
- the set to fill in.context
- the context defining the type of access with some additional parameters.userId
- the unique identifier of the user.spaceId
- the resource in Silverpeas accessed by the user.
-
hasUserSpaceManagementAuthorization
public boolean hasUserSpaceManagementAuthorization(String userId, String spaceId, AccessControlContext context)
Description copied from interface:SpaceAccessControl
Checks if the specified user may manage the specified space represented by its identifier.- Specified by:
hasUserSpaceManagementAuthorization
in interfaceSpaceAccessControl
- Parameters:
userId
- the unique identifier of the user.spaceId
- the full identifier of a space.context
- the context in which the space is accessed.- Returns:
- true if space management is granted, false otherwise.
-
-