public final class RBACService extends Object
Modifier and Type | Method and Description |
---|---|
static <E extends fr.paris.lutece.portal.service.rbac.RBACAction> |
getAuthorizedActionsCollection(Collection<E> collection,
fr.paris.lutece.portal.service.rbac.RBACResource resource,
AdminUser user)
Filter a collection of RBACAction for a given user
|
static <E extends fr.paris.lutece.portal.service.rbac.RBACResource> |
getAuthorizedCollection(Collection<E> collection,
String strPermission,
AdminUser user)
Filter a collection of resources for a given user
|
static ReferenceList |
getAuthorizedReferenceList(ReferenceList listResources,
String strResourceType,
String strPermission,
AdminUser user)
Filter a Reference List for a given user
|
static boolean |
isAuthorized(fr.paris.lutece.portal.service.rbac.RBACResource resource,
String strPermission,
AdminUser user)
Check that a given user is allowed to access a resource for a given permission
|
static boolean |
isAuthorized(String strResourceTypeCode,
String strResourceId,
String strPermission,
AdminUser user)
Check that a given user is allowed to access a resource for a given permission
|
static boolean |
isUserInRole(AdminUser user,
String strRole)
Check that a given user is in the given role
|
public static boolean isAuthorized(String strResourceTypeCode, String strResourceId, String strPermission, AdminUser user)
strResourceTypeCode
- the key of the resource type being consideredstrResourceId
- the id of the resource being consideredstrPermission
- the permission neededuser
- the user trying to access the ressourcepublic static boolean isAuthorized(fr.paris.lutece.portal.service.rbac.RBACResource resource, String strPermission, AdminUser user)
resource
- the resource object being consideredstrPermission
- the permission neededuser
- the user trying to access the ressourcepublic static boolean isUserInRole(AdminUser user, String strRole)
user
- The userstrRole
- The rolepublic static <E extends fr.paris.lutece.portal.service.rbac.RBACResource> Collection<E> getAuthorizedCollection(Collection<E> collection, String strPermission, AdminUser user)
E
- The RBAC resourcecollection
- The collection to filterstrPermission
- Permission to checkuser
- The userpublic static ReferenceList getAuthorizedReferenceList(ReferenceList listResources, String strResourceType, String strPermission, AdminUser user)
listResources
- The list to filterstrResourceType
- The resource typestrPermission
- The permission to checkuser
- The userpublic static <E extends fr.paris.lutece.portal.service.rbac.RBACAction> Collection<E> getAuthorizedActionsCollection(Collection<E> collection, fr.paris.lutece.portal.service.rbac.RBACResource resource, AdminUser user)
E
- The RBAC resourcecollection
- The collection to filterresource
- The resourceuser
- The userCopyright © 2020 City of Paris. All rights reserved.