discontinuedPackage thingsboard_pe_client has been discontinued and replaced by thingsboard_client.

Role class abstract

A JSON value representing the role.

Properties:

  • id - JSON object with the Role Id. Specify this field to update the Role. Referencing non-existing Role Id will cause error. Omit this field to create new Role.
  • createdTime - Timestamp of the role creation, in milliseconds
  • additionalInfo - Additional parameters of the role. May include: 'description' (string).
  • tenantId - JSON object with Tenant Id.
  • customerId - JSON object with Customer Id. Optional: when omitted the Role is owned by the tenant. When the request is made by a Customer user, the value is forced to the user's own Customer Id.
  • name - Role Name
  • type - Type of the role: generic or group
  • permissions - Set of permissions granted by this role. The JSON shape depends on the role 'type': * GENERIC — JSON object mapping Resource enum names to arrays of Operation enum names allowed on that resource. The wildcard entry {\"ALL\":[\"ALL\"]} grants every operation on every resource. * GROUP — JSON array of Operation enum names that apply to the entity group this role is bound to via GroupPermission.entityGroupId. Only operations with allowedForGroupRole=true may appear (see Operation enum). The wildcard entry [\"ALL\"] grants every supported operation on the bound entity group.
  • excludedPermissions - Operations to subtract from those granted by permissions. Only applicable to GENERIC roles — setting this on a GROUP role is rejected by validation. Same shape as the GENERIC variant of permissions: a JSON object mapping Resource enum names to non-empty arrays of Operation enum names. At evaluation time, for each resource the listed operations are removed from the resolved permission set (e.g. permissions={\"ALL\":[\"ALL\"]} combined with excludedPermissions={\"DEVICE\":[\"DELETE\"]} grants everything except deleting devices). May be null or an empty object when no exclusions apply.
  • version
  • ownerId - JSON object with Customer or Tenant Id
Annotations
  • @BuiltValue.new()

Constructors

Role([void updates(RoleBuilder b)])
factory

Properties

additionalInfo → JsonObject?
Additional parameters of the role. May include: 'description' (string).
no setter
createdTime → int?
Timestamp of the role creation, in milliseconds
no setter
customerId → CustomerId?
JSON object with Customer Id. Optional: when omitted the Role is owned by the tenant. When the request is made by a Customer user, the value is forced to the user's own Customer Id.
no setter
excludedPermissions → JsonObject?
Operations to subtract from those granted by permissions. Only applicable to GENERIC roles — setting this on a GROUP role is rejected by validation. Same shape as the GENERIC variant of permissions: a JSON object mapping Resource enum names to non-empty arrays of Operation enum names. At evaluation time, for each resource the listed operations are removed from the resolved permission set (e.g. permissions={\"ALL\":[\"ALL\"]} combined with excludedPermissions={\"DEVICE\":[\"DELETE\"]} grants everything except deleting devices). May be null or an empty object when no exclusions apply.
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → RoleId?
JSON object with the Role Id. Specify this field to update the Role. Referencing non-existing Role Id will cause error. Omit this field to create new Role.
no setter
name → String
Role Name
no setter
ownerId → EntityId?
JSON object with Customer or Tenant Id
no setter
permissions → JsonObject?
Set of permissions granted by this role. The JSON shape depends on the role 'type': * GENERIC — JSON object mapping Resource enum names to arrays of Operation enum names allowed on that resource. The wildcard entry {\"ALL\":[\"ALL\"]} grants every operation on every resource. * GROUP — JSON array of Operation enum names that apply to the entity group this role is bound to via GroupPermission.entityGroupId. Only operations with allowedForGroupRole=true may appear (see Operation enum). The wildcard entry [\"ALL\"] grants every supported operation on the bound entity group.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tenantId → TenantId?
JSON object with Tenant Id.
no setter
type → RoleType
Type of the role: generic or group
no setter
version → int?
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rebuild(dynamic updates(RoleBuilder)) → Role
Rebuilds the instance.
inherited
toBuilder() → RoleBuilder
Converts the instance to a builder B.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

serializer → Serializer<Role>
no setter