public class AccessControlUtil extends java.lang.Object implements AccessControlConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
ADMIN_RESOURCE, CTXT_DATA, CTXT_WORKSPACE, GRP_EDIT_RESOURCE, MBR_EDIT_RESOURCE, WORKSPACE_ADMIN_RESOURCE, WS_EDIT_RESOURCE, WSGRP_EDIT_RESOURCE, WSMBR_EDIT_RESOURCE
Constructor and Description |
---|
AccessControlUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
countMatches(java.lang.String str,
java.lang.String sub) |
static java.util.Map<java.lang.String,java.lang.Object> |
getContext(Workspace workspace,
java.lang.Object... keyValuePairs)
Retrieve a new context Map suitable for parameter in AccessControlManager access check.
|
static java.util.LinkedHashMap<java.lang.String,java.lang.Integer> |
getOrderedResourcesAndLevelMap()
Retrieve a Map of all resources with their corresponding hierarchy level.
|
static java.lang.String |
getParentResource(java.lang.String resource)
Retrieve the parent resource of the specified resource.
|
static boolean |
isAdminResource(java.lang.String resource)
Check if the specified resource is an administration resource.
|
static boolean |
isDataResource(java.lang.String resource)
Check if the specified resource is a resource related to edition of any Data.
|
static boolean |
isWorkspaceAdminResource(java.lang.String resource)
Check if the specified resource is a workspace resource.
|
public static final java.lang.String REVISION
public static boolean isDataResource(java.lang.String resource)
resource
- the resource idpublic static boolean isAdminResource(java.lang.String resource)
resource
- the resource idpublic static boolean isWorkspaceAdminResource(java.lang.String resource)
resource
- the resource idpublic static java.util.LinkedHashMap<java.lang.String,java.lang.Integer> getOrderedResourcesAndLevelMap()
The Map is sorted so that iterating it can provide a complete and valid resource tree.
For example :
admin -> 0, admin/dev -> 1, admin/dev/store-cleaner -> 2, admin/dev/types -> 2, admin/users -> 1, admin/users/member -> 2, ...
public static int countMatches(java.lang.String str, java.lang.String sub)
public static java.util.Map<java.lang.String,java.lang.Object> getContext(Workspace workspace, java.lang.Object... keyValuePairs)
workspace
- the current workspacekeyValuePairs
- an even number of argument corresponding to key/pair to put in the mapAccessControlManager.checkAccess(com.jalios.jcms.Member, String, Map)
public static java.lang.String getParentResource(java.lang.String resource)
resource
- a resource URI, seperated with slash, eg "admin/dev/store-cleaner"Copyright © 2001-2010 Jalios SA. All Rights Reserved.