public class PermissionUtil extends Object
Constructor and Description |
---|
PermissionUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
convertPermissions(String newPermissions)
Return String-representation of permissions convert from provided long-permission (old).
|
static AccessManager |
getAccessManager(String workspace,
Subject subject)
Creates instance of AccessManager configured with subject principal permissions for requested workspace/repository.
|
static boolean |
isGranted(javax.jcr.Node node,
long requiredPermissions)
Convenience call hiding all ugly details of permission conversions.
|
static boolean |
isGranted(javax.jcr.Session jcrSession,
String path,
long oldPermissions)
Return whether given session has requested permission on provided path.
|
static boolean |
isGranted(javax.jcr.Session jcrSession,
String path,
String action)
Return whether given session has requested permission on provided path.
|
static boolean |
isGranted(String workspace,
String path,
String requiredPermissions)
Convenience call hiding all ugly details of permission conversions.
|
static void |
verifyIsGrantedOrThrowException(javax.jcr.Session jcrSession,
String path,
String action)
Checks whether given session has requested permission on provided path.
|
public static AccessManager getAccessManager(String workspace, Subject subject)
public static boolean isGranted(javax.jcr.Node node, long requiredPermissions) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- in case node or its parent session is invalid.public static boolean isGranted(String workspace, String path, String requiredPermissions)
public static boolean isGranted(javax.jcr.Session jcrSession, String path, long oldPermissions)
public static boolean isGranted(javax.jcr.Session jcrSession, String path, String action)
IllegalArgumentException
- when provided action is empty.public static long convertPermissions(String newPermissions)
public static void verifyIsGrantedOrThrowException(javax.jcr.Session jcrSession, String path, String action) throws AccessDeniedException
AccessDeniedException
- when permission is not granted.Copyright © 2003–2017 Magnolia International Ltd.. All rights reserved.