|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.accesscontrol.AccessControlUtil
public class AccessControlUtil
Utility methods used for Access Control related operation.
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from interface com.jalios.jcms.accesscontrol.AccessControlConstants |
---|
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 Summary | |
---|---|
AccessControlUtil()
|
Method Summary | |
---|---|
static int |
countMatches(String str,
String sub)
|
static Map<String,Object> |
getContext(Workspace workspace,
Object... keyValuePairs)
Retrieve a new context Map suitable for parameter in AccessControlManager access check. |
static LinkedHashMap<String,Integer> |
getOrderedResourcesAndLevelMap()
Retrieve a Map of all resources with their corresponding hierarchy level. |
static String |
getParentResource(String resource)
Retrieve the parent resource of the specified resource. |
static boolean |
isAdminResource(String resource)
Check if the specified resource is an administration resource. |
static boolean |
isDataResource(String resource)
Check if the specified resource is a resource related to edition of any Data. |
static boolean |
isWorkspaceAdminResource(String resource)
Check if the specified resource is a workspace resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public AccessControlUtil()
Method Detail |
---|
public static boolean isDataResource(String resource)
resource
- the resource id
public static boolean isAdminResource(String resource)
resource
- the resource id
public static boolean isWorkspaceAdminResource(String resource)
resource
- the resource id
public static LinkedHashMap<String,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(String str, String sub)
public static Map<String,Object> getContext(Workspace workspace, Object... keyValuePairs)
workspace
- the current workspacekeyValuePairs
- an even number of argument corresponding to key/pair to put in the map
AccessControlManager.checkAccess(com.jalios.jcms.Member, String, Map)
public static String getParentResource(String resource)
resource
- a resource URI, seperated with slash, eg "admin/dev/store-cleaner"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |