Class ResourceTypeUtil

java.lang.Object
org.camunda.bpm.engine.impl.util.ResourceTypeUtil

public class ResourceTypeUtil extends Object
  • Field Details

    • PERMISSION_ENUMS

      protected static final Map<Integer,Class<? extends Enum<? extends Permission>>> PERMISSION_ENUMS
      A map containing all Resources as a key and the respective Permission Enum class for this resource.

      NOTE: In case of new Permission Enum class, please adjust the map accordingly

  • Constructor Details

    • ResourceTypeUtil

      public ResourceTypeUtil()
  • Method Details

    • 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 the Permission array based on the predifined PERMISSION_ENUMS
    • getPermissionByNameAndResourceType

      public static Permission getPermissionByNameAndResourceType(String permissionName, int resourceType)
      Currently used only in the Rest API Returns a Permission based on the specified permissionName and resourceType
      Throws:
      BadUserRequestException - in case the permission is not valid for the specified resource type
    • getResourceByType

      public static Resource getResourceByType(int resourceType)
      Iterates over the Resources and returns either the resource with specified resourceType or null.