Class CorePermissionsService
- java.lang.Object
-
- com.composum.sling.core.service.impl.CorePermissionsService
-
- All Implemented Interfaces:
PermissionsService
public class CorePermissionsService extends Object implements PermissionsService
-
-
Constructor Summary
Constructors Constructor Description CorePermissionsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasAllPrivileges(javax.jcr.Session session, String path, String... privilegeKeys)
String
hasOneOfPrivileges(javax.jcr.Session session, String path, String... privilegeKeys)
boolean
isMemberOfAll(javax.jcr.Session session, String... authorizableIds)
String
isMemberOfOne(javax.jcr.Session session, String... authorizableIds)
-
-
-
Method Detail
-
isMemberOfOne
public String isMemberOfOne(javax.jcr.Session session, String... authorizableIds)
- Specified by:
isMemberOfOne
in interfacePermissionsService
- Parameters:
session
- the current sessionauthorizableIds
- a list of group ids to check- Returns:
- the first matching group found; NULL if no group found; probably "" if user is 'admin'
-
isMemberOfAll
public boolean isMemberOfAll(javax.jcr.Session session, String... authorizableIds)
- Specified by:
isMemberOfAll
in interfacePermissionsService
- Parameters:
session
- the current sessionauthorizableIds
- a list of group ids to check- Returns:
- 'true' if session user is member of all groups (or of THE group if only one is checked)
-
hasOneOfPrivileges
public String hasOneOfPrivileges(javax.jcr.Session session, String path, String... privilegeKeys)
- Specified by:
hasOneOfPrivileges
in interfacePermissionsService
- Parameters:
session
- the current sessionprivilegeKeys
- a list of privilege keys to check- Returns:
- the first privilege found; NULL if no privilege found
-
hasAllPrivileges
public boolean hasAllPrivileges(javax.jcr.Session session, String path, String... privilegeKeys)
- Specified by:
hasAllPrivileges
in interfacePermissionsService
- Parameters:
session
- the current sessionprivilegeKeys
- a list of privilege keys to check- Returns:
- 'true' if session user has all privileges (or has THE privilege if only one is checked)
-
-