Package org.camunda.bpm.engine.impl.util
Class ResourceTypeUtil
- java.lang.Object
-
- org.camunda.bpm.engine.impl.util.ResourceTypeUtil
-
public class ResourceTypeUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<Integer,Class<? extends Enum<? extends Permission>>>
PERMISSION_ENUMS
A map containing allResources
as a key and the respectivePermission
Enum class for this resource.
-
Constructor Summary
Constructors Constructor Description ResourceTypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Permission
getPermissionByNameAndResourceType(String permissionName, int resourceType)
Currently used only in the Rest API Returns aPermission
based on the specifiedpermissionName
andresourceType
static Map<Integer,Class<? extends Enum<? extends Permission>>>
getPermissionEnums()
static Permission[]
getPermissionsByResourceType(int givenResourceType)
Retrieves thePermission
array based on the predifinedPERMISSION_ENUMS
static Resource
getResourceByType(int resourceType)
static boolean
resourceIsContainedInArray(Integer resourceTypeId, Resource[] resources)
-
-
-
Field Detail
-
PERMISSION_ENUMS
protected static final Map<Integer,Class<? extends Enum<? extends Permission>>> PERMISSION_ENUMS
A map containing allResources
as a key and the respectivePermission
Enum class for this resource.NOTE: In case of new
Permission
Enum class, please adjust the map accordingly
-
-
Method Detail
-
resourceIsContainedInArray
public static boolean resourceIsContainedInArray(Integer resourceTypeId, Resource[] resources)
- Returns:
true
in case the resource with the provided resourceTypeId is contained by the specified list
-
getPermissionEnums
public static Map<Integer,Class<? extends Enum<? extends Permission>>> getPermissionEnums()
- Returns:
- See
PERMISSION_ENUMS
-
getPermissionsByResourceType
public static Permission[] getPermissionsByResourceType(int givenResourceType)
Retrieves thePermission
array based on the predifinedPERMISSION_ENUMS
-
getPermissionByNameAndResourceType
public static Permission getPermissionByNameAndResourceType(String permissionName, int resourceType)
Currently used only in the Rest API Returns aPermission
based on the specifiedpermissionName
andresourceType
- Throws:
BadUserRequestException
- in case the permission is not valid for the specified resource type
-
getResourceByType
public static Resource getResourceByType(int resourceType)
-
-