core/common/permissions.service.ts
constructor(appState: AppStateService, inventory: InventoryService, user: UserService)
|
||||||||||||
Parameters :
|
canEdit | ||||||||||||||||||||
canEdit(roleIds: string[], mo: IManagedObject | IIdentified, config: CanEditConfig)
|
||||||||||||||||||||
Checks if the current user has write permissions for the given mo (either through global role, individual device permissions or via inventory roles). Example :
Parameters :
Returns :
Promise<boolean>
A Promise resolving to a boolean value. |
Protected Async checkWithRequest | ||||||||
checkWithRequest(mo: IManagedObject | IIdentified)
|
||||||||
Decorators :
@memoize(undefined)
|
||||||||
Attempts to perform a partial update on a managed object as a means to check for edit permissions. Utilizes memoization to cache the result based on the managed object's id, thereby avoiding unnecessary repeated requests for the same object. This method essentially tests if the current user has permission to update the managed object, serving as an indirect permission check. Example :
Parameters :
Returns :
Promise<boolean>
A promise that resolves to |
hasAllRoles | ||||||||
hasAllRoles(roleIds: string[])
|
||||||||
Checks if the current user possesses all the specified roles. Example :
Parameters :
Returns :
boolean
A boolean value indicating whether the current user has all the specified roles. |
hasAnyGlobalRole | ||||||||
hasAnyGlobalRole(globalRolesIds: number[])
|
||||||||
Checks if the current user possesses any of the specified global roles. Example :
Parameters :
Returns :
boolean
A boolean value indicating whether the current user has any of the specified global roles. |
hasAnyRole | ||||||||
hasAnyRole(roleIds: string[])
|
||||||||
Checks if the current user possesses any of the specified roles. Example :
Parameters :
Returns :
boolean
A boolean value indicating whether the current user has any of the specified roles. |
hasRole | ||||||||
hasRole(roleId: string)
|
||||||||
Checks if the current user has the specified role. Example :
Parameters :
Returns :
boolean
A boolean value indicating whether the current user has the specified role. |
Static ROLE_ADVANCED_SOFTWARE_ADMIN |
Type : string
|
Default value : 'ROLE_ADVANCED_SOFTWARE_ADMIN'
|
Static ROLE_ADVANCED_SOFTWARE_READ |
Type : string
|
Default value : 'ROLE_ADVANCED_SOFTWARE_READ'
|
Static ROLE_ALARM_ADMIN |
Type : string
|
Default value : 'ROLE_ALARM_ADMIN'
|
Static ROLE_ALARM_READ |
Type : string
|
Default value : 'ROLE_ALARM_READ'
|
Static ROLE_ANALYTICSBUILDER_READ |
Type : string
|
Default value : 'ROLE_ANALYTICSBUILDER_READ'
|
Static ROLE_APPLICATION_MANAGEMENT_ADMIN |
Type : string
|
Default value : 'ROLE_APPLICATION_MANAGEMENT_ADMIN'
|
Static ROLE_APPLICATION_MANAGEMENT_READ |
Type : string
|
Default value : 'ROLE_APPLICATION_MANAGEMENT_READ'
|
Static ROLE_AUDIT_ADMIN |
Type : string
|
Default value : 'ROLE_AUDIT_ADMIN'
|
Static ROLE_AUDIT_READ |
Type : string
|
Default value : 'ROLE_AUDIT_READ'
|
Static ROLE_BINARY_ADMIN |
Type : string
|
Default value : 'ROLE_BINARY_ADMIN'
|
Static ROLE_BINARY_CREATE |
Type : string
|
Default value : 'ROLE_BINARY_CREATE'
|
Static ROLE_BINARY_READ |
Type : string
|
Default value : 'ROLE_BINARY_READ'
|
Static ROLE_BULK_OPERATION_ADMIN |
Type : string
|
Default value : 'ROLE_BULK_OPERATION_ADMIN'
|
Static ROLE_BULK_OPERATION_READ |
Type : string
|
Default value : 'ROLE_BULK_OPERATION_READ'
|
Static ROLE_CEP_MANAGEMENT_ADMIN |
Type : string
|
Default value : 'ROLE_CEP_MANAGEMENT_ADMIN'
|
Static ROLE_CEP_MANAGEMENT_READ |
Type : string
|
Default value : 'ROLE_CEP_MANAGEMENT_READ'
|
Static ROLE_DATA_BROKER_ADMIN |
Type : string
|
Default value : 'ROLE_DATA_BROKER_ADMIN'
|
Static ROLE_DATA_BROKER_READ |
Type : string
|
Default value : 'ROLE_DATA_BROKER_READ'
|
Static ROLE_DEVICE_CONTROL_ADMIN |
Type : string
|
Default value : 'ROLE_DEVICE_CONTROL_ADMIN'
|
Static ROLE_DEVICE_CONTROL_READ |
Type : string
|
Default value : 'ROLE_DEVICE_CONTROL_READ'
|
Static ROLE_EMAIL_CREATE |
Type : string
|
Default value : 'ROLE_EMAIL_CREATE'
|
Static ROLE_EPLAPPS_READ |
Type : string
|
Default value : 'ROLE_EPLAPPS_READ'
|
Static ROLE_EVENT_ADMIN |
Type : string
|
Default value : 'ROLE_EVENT_ADMIN'
|
Static ROLE_EVENT_READ |
Type : string
|
Default value : 'ROLE_EVENT_READ'
|
Static ROLE_GENERIC_MQTT_ADMIN |
Type : string
|
Default value : 'ROLE_GENERIC_MQTT_ADMIN'
|
Static ROLE_IDENTITY_ADMIN |
Type : string
|
Default value : 'ROLE_IDENTITY_ADMIN'
|
Static ROLE_IDENTITY_READ |
Type : string
|
Default value : 'ROLE_IDENTITY_READ'
|
Static ROLE_INVENTORY_ADMIN |
Type : string
|
Default value : 'ROLE_INVENTORY_ADMIN'
|
Static ROLE_INVENTORY_CREATE |
Type : string
|
Default value : 'ROLE_INVENTORY_CREATE'
|
Static ROLE_INVENTORY_READ |
Type : string
|
Default value : 'ROLE_INVENTORY_READ'
|
Static ROLE_MACHINE_LEARNING_READ |
Type : string
|
Default value : 'ROLE_MACHINE_LEARNING_READ'
|
Static ROLE_MANAGED_OBJECT_ADMIN |
Type : string
|
Default value : 'ROLE_MANAGED_OBJECT_ADMIN'
|
Static ROLE_MANAGED_OBJECT_CREATE |
Type : string
|
Default value : 'ROLE_MANAGED_OBJECT_CREATE'
|
Static ROLE_MANAGED_OBJECT_READ |
Type : string
|
Default value : 'ROLE_MANAGED_OBJECT_READ'
|
Static ROLE_MEASUREMENT_ADMIN |
Type : string
|
Default value : 'ROLE_MEASUREMENT_ADMIN'
|
Static ROLE_MEASUREMENT_READ |
Type : string
|
Default value : 'ROLE_MEASUREMENT_READ'
|
Static ROLE_MQTT_CONNECT_ADMIN |
Type : string
|
Default value : 'ROLE_MQTT_CONNECT_ADMIN'
|
Static ROLE_MQTT_SERVICE_ADMIN |
Type : string
|
Default value : 'ROLE_MQTT_SERVICE_ADMIN'
|
Static ROLE_NOTIFICATION_2_ADMIN |
Type : string
|
Default value : 'ROLE_NOTIFICATION_2_ADMIN'
|
Static ROLE_OPTION_MANAGEMENT_ADMIN |
Type : string
|
Default value : 'ROLE_OPTION_MANAGEMENT_ADMIN'
|
Static ROLE_OPTION_MANAGEMENT_READ |
Type : string
|
Default value : 'ROLE_OPTION_MANAGEMENT_READ'
|
Static ROLE_PROVISIONING_CREATE |
Type : string
|
Default value : 'ROLE_PROVISIONING_CREATE'
|
Static ROLE_PROVISIONING_READ |
Type : string
|
Default value : 'ROLE_PROVISIONING_READ'
|
Static ROLE_PROVISIONING_UPDATE |
Type : string
|
Default value : 'ROLE_PROVISIONING_UPDATE'
|
Static ROLE_REMOTE_ACCESS_ADMIN |
Type : string
|
Default value : 'ROLE_REMOTE_ACCESS_ADMIN'
|
Static ROLE_RETENTION_RULE_ADMIN |
Type : string
|
Default value : 'ROLE_RETENTION_RULE_ADMIN'
|
Static ROLE_RETENTION_RULE_READ |
Type : string
|
Default value : 'ROLE_RETENTION_RULE_READ'
|
Static ROLE_SCHEDULE_REPORT_ADMIN |
Type : string
|
Default value : 'ROLE_SCHEDULE_REPORT_ADMIN'
|
Static ROLE_SIMULATOR_ADMIN |
Type : string
|
Default value : 'ROLE_SIMULATOR_ADMIN'
|
Static ROLE_SMARTGROUP_ADMIN |
Type : string
|
Default value : 'ROLE_SMARTGROUP_ADMIN'
|
Static ROLE_SMARTGROUP_CREATE |
Type : string
|
Default value : 'ROLE_SMARTGROUP_CREATE'
|
Static ROLE_SMARTGROUP_UPDATE |
Type : string
|
Default value : 'ROLE_SMARTGROUP_UPDATE'
|
Static ROLE_SMARTRULE_ADMIN |
Type : string
|
Default value : 'ROLE_SMARTRULE_ADMIN'
|
Static ROLE_SMARTRULE_READ |
Type : string
|
Default value : 'ROLE_SMARTRULE_READ'
|
Static ROLE_SMS_ADMIN |
Type : string
|
Default value : 'ROLE_SMS_ADMIN'
|
Static ROLE_SMS_READ |
Type : string
|
Default value : 'ROLE_SMS_READ'
|
Static ROLE_TENANT_ADMIN |
Type : string
|
Default value : 'ROLE_TENANT_ADMIN'
|
Static ROLE_TENANT_MANAGEMENT_ADMIN |
Type : string
|
Default value : 'ROLE_TENANT_MANAGEMENT_ADMIN'
|
Static ROLE_TENANT_MANAGEMENT_CREATE |
Type : string
|
Default value : 'ROLE_TENANT_MANAGEMENT_CREATE'
|
Static ROLE_TENANT_MANAGEMENT_READ |
Type : string
|
Default value : 'ROLE_TENANT_MANAGEMENT_READ'
|
Static ROLE_TENANT_MANAGEMENT_UPDATE |
Type : string
|
Default value : 'ROLE_TENANT_MANAGEMENT_UPDATE'
|
Static ROLE_TENANT_STATISTICS_READ |
Type : string
|
Default value : 'ROLE_TENANT_STATISTICS_READ'
|
Static ROLE_USER_MANAGEMENT_ADMIN |
Type : string
|
Default value : 'ROLE_USER_MANAGEMENT_ADMIN'
|
Static ROLE_USER_MANAGEMENT_CREATE |
Type : string
|
Default value : 'ROLE_USER_MANAGEMENT_CREATE'
|
Static ROLE_USER_MANAGEMENT_OWN_ADMIN |
Type : string
|
Default value : 'ROLE_USER_MANAGEMENT_OWN_ADMIN'
|
Static ROLE_USER_MANAGEMENT_OWN_READ |
Type : string
|
Default value : 'ROLE_USER_MANAGEMENT_OWN_READ'
|
Static ROLE_USER_MANAGEMENT_READ |
Type : string
|
Default value : 'ROLE_USER_MANAGEMENT_READ'
|