Package org.camunda.bpm.engine.impl.util
Class ResourceTypeUtil
- java.lang.Object
-
- org.camunda.bpm.engine.impl.util.ResourceTypeUtil
-
public class ResourceTypeUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.Integer,java.lang.Class<? extends java.lang.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(java.lang.String permissionName, int resourceType)
Currently used only in the Rest API Returns aPermission
based on the specifiedpermissionName
andresourceType
static java.util.Map<java.lang.Integer,java.lang.Class<? extends java.lang.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(java.lang.Integer resourceTypeId, Resource[] resources)
-
-
-
Field Detail
-
PERMISSION_ENUMS
protected static final java.util.Map<java.lang.Integer,java.lang.Class<? extends java.lang.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(java.lang.Integer resourceTypeId, Resource[] resources)
- Returns:
true
in case the resource with the provided resourceTypeId is contained by the specified list
-
getPermissionEnums
public static java.util.Map<java.lang.Integer,java.lang.Class<? extends java.lang.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(java.lang.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)
-
-