public class ResourceTypeUtil extends Object
Constructor and Description |
---|
ResourceTypeUtil() |
Modifier and Type | Method and Description |
---|---|
static Permission |
getPermissionByNameAndResourceType(String permissionName,
int resourceType)
Currently used only in the Rest API
Returns a
Permission based on the specified permissionName and resourceType |
static Map<Integer,Class<? extends Enum<? extends Permission>>> |
getPermissionEnums() |
static Permission[] |
getPermissionsByResourceType(int givenResourceType)
Retrieves the
Permission array based on the predifined PERMISSION_ENUMS |
static Resource |
getResourceByType(int resourceType)
|
static boolean |
resourceIsContainedInArray(Integer resourceTypeId,
Resource[] resources) |
public static boolean resourceIsContainedInArray(Integer resourceTypeId, Resource[] resources)
true
in case the resource with the provided resourceTypeId is contained by the specified listpublic static Map<Integer,Class<? extends Enum<? extends Permission>>> getPermissionEnums()
PERMISSION_ENUMS
public static Permission[] getPermissionsByResourceType(int givenResourceType)
Permission
array based on the predifined PERMISSION_ENUMS
public static Permission getPermissionByNameAndResourceType(String permissionName, int resourceType)
Permission
based on the specified permissionName
and resourceType
BadUserRequestException
- in case the permission is not valid for the specified resource typepublic static Resource getResourceByType(int resourceType)
Copyright © 2021. All rights reserved.