Class PublicationAccessController
- java.lang.Object
-
- org.silverpeas.core.security.authorization.AbstractAccessController<PublicationPK>
-
- org.silverpeas.core.security.authorization.PublicationAccessController
-
- All Implemented Interfaces:
AccessController<PublicationPK>
,PublicationAccessControl
@Service @Singleton public class PublicationAccessController extends AbstractAccessController<PublicationPK> implements PublicationAccessControl
Check the access to a publication for a user.- Author:
- neysseric
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fillUserRoles(Set<SilverpeasRole> userRoles, AccessControlContext context, String userId, PublicationPK publicationPK)
Fills in the specified set the roles the user plays for the given resource in Silverpeas according to the specified access context.Stream<PublicationDetail>
filterAuthorizedByUser(String userId, Collection<PublicationDetail> pubs, AccessControlContext context)
Using this method avoid to use perform database request in order to retrieve publication data.Stream<PublicationPK>
filterAuthorizedByUser(Collection<PublicationPK> pks, String userId, AccessControlContext context)
Filters the given object list in order to keep those the specified user is authorized on.boolean
isUserAuthorized(String userId, PublicationDetail pubDetail)
Using this method avoid to use perform database request in order to retrieve publication data.boolean
isUserAuthorized(String userId, PublicationDetail pubDetail, AccessControlContext context)
Using this method avoid to use perform database request in order to retrieve publication data.boolean
isUserAuthorized(String userId, PublicationPK pubPk, AccessControlContext context)
Checks if the specified user may access the specified object.boolean
isUserAuthorized(String userId, ResourceIdentifier id)
Checks if the specified user may access the object with the specified identifier.-
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.PublicationAccessControl
filterAuthorizedByUser
-
-
-
-
Method Detail
-
isUserAuthorized
public boolean isUserAuthorized(String userId, ResourceIdentifier id)
Description copied from interface:AccessController
Checks if the specified user may access the object with the specified identifier.- Specified by:
isUserAuthorized
in interfaceAccessController<PublicationPK>
- Parameters:
userId
- the unique identifier of the user.id
- the unique identifier of the object to be accessed in Silverpeas.- Returns:
- true if access is granted - false otherwise.
-
filterAuthorizedByUser
public Stream<PublicationDetail> filterAuthorizedByUser(String userId, Collection<PublicationDetail> pubs, AccessControlContext context)
Description copied from interface:PublicationAccessControl
Using this method avoid to use perform database request in order to retrieve publication data.- Specified by:
filterAuthorizedByUser
in interfacePublicationAccessControl
-
filterAuthorizedByUser
public Stream<PublicationPK> filterAuthorizedByUser(Collection<PublicationPK> pks, 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<PublicationPK>
- Overrides:
filterAuthorizedByUser
in classAbstractAccessController<PublicationPK>
- Parameters:
pks
- 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.
-
isUserAuthorized
public boolean isUserAuthorized(String userId, PublicationDetail pubDetail)
Description copied from interface:PublicationAccessControl
Using this method avoid to use perform database request in order to retrieve publication data.- Specified by:
isUserAuthorized
in interfacePublicationAccessControl
-
isUserAuthorized
public boolean isUserAuthorized(String userId, PublicationDetail pubDetail, AccessControlContext context)
Description copied from interface:PublicationAccessControl
Using this method avoid to use perform database request in order to retrieve publication data.- Specified by:
isUserAuthorized
in interfacePublicationAccessControl
-
isUserAuthorized
public boolean isUserAuthorized(String userId, PublicationPK pubPk, AccessControlContext context)
Description copied from interface:AccessController
Checks if the specified user may access the specified object.- Specified by:
isUserAuthorized
in interfaceAccessController<PublicationPK>
- Parameters:
userId
- the unique identifier of the user.pubPk
- the object to be accessed.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, PublicationPK publicationPK)
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<PublicationPK>
- 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.publicationPK
- the resource in Silverpeas accessed by the user.
-
-