import { DecodedToken } from 'src/app/storage/Token' ; export const API_GET_ITEM_ACTION = 'GET_ITEM' ; export const API_GET_LIST_ACTION = 'GET_LIST' ; export const API_CREATE_ACTION = 'POST' ; export const API_DELETE_ACTION = 'DELETE' ; export const API_UPDATE_ACTION = 'PUT' ; export const ROLE_ADMIN = 'ROLE_ADMIN' ; export const ROLE_PENTESTER = 'ROLE_PENTESTER' ; export const ROLE_MANAGER = 'ROLE_MANAGER' ; export const ROLE_CLIENT = 'ROLE_CLIENT' ; export const ROLE_CLIENT_MANAGE = 'ROLE_CLIENT_MANAGE' ; export const ROLE_HOST_MANAGE = 'ROLE_HOST_MANAGE' ; export const ROLE_IMPACT_MANAGE = 'ROLE_IMPACT_MANAGE' ; export const ROLE_MISSION_MANAGE = 'ROLE_MISSION_MANAGE' ; export const ROLE_MISSION_TYPE_MANAGE = 'ROLE_MISSION_TYPE_MANAGE' ; export const ROLE_NEGATIVE_POINT_MANAGE = 'ROLE_NEGATIVE_POINT_MANAGE' ; export const ROLE_POSITIVE_POINT_MANAGE = 'ROLE_POSITIVE_POINT_MANAGE' ; export const ROLE_VULN_MANAGE = 'ROLE_VULN_MANAGE' ; export const ROLE_VULN_TYPE_MANAGE = 'ROLE_VULN_TYPE_MANAGE' ; export const ROLE_MISSION_GET_ITEM = 'ROLE_MISSION_GET_ITEM' ; export const ROLE_MISSION_GET_LIST = 'ROLE_MISSION_GET_LIST' ; export const ROLE_MISSION_PATCH = 'ROLE_MISSION_PATCH' ; export const ROLE_MISSION_PUT = 'ROLE_MISSION_PUT' ; export const ROLE_STEP_MANAGE = 'ROLE_STEP_MANAGE' ; export const ROLE_USER_GET_ITEM = 'ROLE_USER_GET_ITEM' ; export const ROLE_USER_GET_LIST = 'ROLE_USER_GET_LIST' ; export const ROLE_USER_PATCH = 'ROLE_USER_PATCH' ; export const ROLE_USER_PUT = 'ROLE_USER_PUT' ; export const ROLE_HOST_VULN_MANAGE = 'ROLE_HOST_VULN_MANAGE' ; export const ROLE_HOST_UPLOAD = 'ROLE_HOST_UPLOAD' ; export const ROLE_USER_MANAGE = 'ROLE_USER_MANAGE' ; export const ROLE_CLIENT_GET_LIST = 'ROLE_CLIENT_GET_LIST' ; export const ROLE_CLIENT_POST = 'ROLE_CLIENT_POST' ; export const ROLE_CLIENT_PUT = 'ROLE_CLIENT_PUT' ; export const ROLE_CLIENT_PATCH = 'ROLE_CLIENT_PATCH' ; export const ROLE_CLIENT_DELETE = 'ROLE_CLIENT_DELETE' ; export const ROLE_CLIENT_GET_ITEM = 'ROLE_CLIENT_GET_ITEM' ; export const ROLE_HOST_GET_LIST = 'ROLE_HOST_GET_LIST' ; export const ROLE_HOST_POST = 'ROLE_HOST_POST' ; export const ROLE_HOST_PUT = 'ROLE_HOST_PUT' ; export const ROLE_HOST_PATCH = 'ROLE_HOST_PATCH' ; export const ROLE_HOST_DELETE = 'ROLE_HOST_DELETE' ; export const ROLE_HOST_GET_ITEM = 'ROLE_HOST_GET_ITEM' ; export const ROLE_IMPACT_GET_LIST = 'ROLE_IMPACT_GET_LIST' ; export const ROLE_IMPACT_POST = 'ROLE_IMPACT_POST' ; export const ROLE_IMPACT_PUT = 'ROLE_IMPACT_PUT' ; export const ROLE_IMPACT_PATCH = 'ROLE_IMPACT_PATCH' ; export const ROLE_IMPACT_DELETE = 'ROLE_IMPACT_DELETE' ; export const ROLE_IMPACT_GET_ITEM = 'ROLE_IMPACT_GET_ITEM' ; export const ROLE_MISSION_POST = 'ROLE_MISSION_POST' ; export const ROLE_MISSION_DELETE = 'ROLE_MISSION_DELETE' ; export const ROLE_MISSION_TYPE_GET_LIST = 'ROLE_MISSION_TYPE_GET_LIST' ; export const ROLE_MISSION_TYPE_POST = 'ROLE_MISSION_TYPE_POST' ; export const ROLE_MISSION_TYPE_PUT = 'ROLE_MISSION_TYPE_PUT' ; export const ROLE_MISSION_TYPE_PATCH = 'ROLE_MISSION_TYPE_PATCH' ; export const ROLE_MISSION_TYPE_DELETE = 'ROLE_MISSION_TYPE_DELETE' ; export const ROLE_MISSION_TYPE_GET_ITEM = 'ROLE_MISSION_TYPE_GET_ITEM' ; export const ROLE_NEGATIVE_POINT_GET_LIST = 'ROLE_NEGATIVE_POINT_GET_LIST' ; export const ROLE_NEGATIVE_POINT_POST = 'ROLE_NEGATIVE_POINT_POST' ; export const ROLE_NEGATIVE_POINT_PUT = 'ROLE_NEGATIVE_POINT_PUT' ; export const ROLE_NEGATIVE_POINT_PATCH = 'ROLE_NEGATIVE_POINT_PATCH' ; export const ROLE_NEGATIVE_POINT_DELETE = 'ROLE_NEGATIVE_POINT_DELETE' ; export const ROLE_NEGATIVE_POINT_GET_ITEM = 'ROLE_NEGATIVE_POINT_GET_ITEM' ; export const ROLE_POSITIVE_POINT_GET_LIST = 'ROLE_POSITIVE_POINT_GET_LIST' ; export const ROLE_POSITIVE_POINT_POST = 'ROLE_POSITIVE_POINT_POST' ; export const ROLE_POSITIVE_POINT_PUT = 'ROLE_POSITIVE_POINT_PUT' ; export const ROLE_POSITIVE_POINT_PATCH = 'ROLE_POSITIVE_POINT_PATCH' ; export const ROLE_POSITIVE_POINT_DELETE = 'ROLE_POSITIVE_POINT_DELETE' ; export const ROLE_POSITIVE_POINT_GET_ITEM = 'ROLE_POSITIVE_POINT_GET_ITEM' ; export const ROLE_VULN_GET_LIST = 'ROLE_VULN_GET_LIST' ; export const ROLE_VULN_POST = 'ROLE_VULN_POST' ; export const ROLE_VULN_PUT = 'ROLE_VULN_PUT' ; export const ROLE_VULN_PATCH = 'ROLE_VULN_PATCH' ; export const ROLE_VULN_DELETE = 'ROLE_VULN_DELETE' ; export const ROLE_VULN_GET_ITEM = 'ROLE_VULN_GET_ITEM' ; export const ROLE_VULN_TYPE_GET_LIST = 'ROLE_VULN_TYPE_GET_LIST' ; export const ROLE_VULN_TYPE_POST = 'ROLE_VULN_TYPE_POST' ; export const ROLE_VULN_TYPE_PUT = 'ROLE_VULN_TYPE_PUT' ; export const ROLE_VULN_TYPE_PATCH = 'ROLE_VULN_TYPE_PATCH' ; export const ROLE_VULN_TYPE_DELETE = 'ROLE_VULN_TYPE_DELETE' ; export const ROLE_VULN_TYPE_GET_ITEM = 'ROLE_VULN_TYPE_GET_ITEM' ; export const ROLE_STEP_GET_LIST = 'ROLE_STEP_GET_LIST' ; export const ROLE_STEP_POST = 'ROLE_STEP_POST' ; export const ROLE_STEP_PUT = 'ROLE_STEP_PUT' ; export const ROLE_STEP_PATCH = 'ROLE_STEP_PATCH' ; export const ROLE_STEP_DELETE = 'ROLE_STEP_DELETE' ; export const ROLE_STEP_GET_ITEM = 'ROLE_STEP_GET_ITEM' ; export const ROLE_HOST_VULN_GET_LIST = 'ROLE_HOST_VULN_GET_LIST' ; export const ROLE_HOST_VULN_POST = 'ROLE_HOST_VULN_POST' ; export const ROLE_HOST_VULN_PUT = 'ROLE_HOST_VULN_PUT' ; export const ROLE_HOST_VULN_PATCH = 'ROLE_HOST_VULN_PATCH' ; export const ROLE_HOST_VULN_DELETE = 'ROLE_HOST_VULN_DELETE' ; export const ROLE_HOST_VULN_GET_ITEM = 'ROLE_HOST_VULN_GET_ITEM' ; export const ROLE_USER_POST = 'ROLE_USER_POST' ; export const ROLE_USER_DELETE = 'ROLE_USER_DELETE' ; export const ROLE_USER = 'ROLE_USER' ; export const isGranted = ( role ) : boolean => { return new DecodedToken ( ) . getDecoded ( ) . roles . includes ( role ) ; } ;