[]
        
(Showing Draft Content)

Identity-Role

Identity-Role

[GET] /api/v2/identity/roles

Get all roles.

Parameters

Name Type Located In Description Example
IncludePermissions Boolean query Whether include the permissions of the role in the query result. true
IncludeMembers Boolean query Whether include the members of the role in the query result.
SearchType SearchType query The search type, available values are "None" and "Count". "Count"

Response

Status Code: 200

Success

RoleBizModel

[POST] /api/v2/identity/roles

Add a new role.

Request Schema

name

Response

Status Code: 201

Created

RoleModel

Status Code: 400

Bad Request

ApiErrorResult

[GET] /api/v2/identity/roles/non-org-roles

Get all the roles which do not belong to any organization.

Parameters

Name Type Located In Description Example
IncludePermissions Boolean query Whether include the permissions of the role in the query result. true
IncludeMembers Boolean query Whether include the members of the role in the query result.
SearchType SearchType query The search type, available values are "None" and "Count". "Count"

Response

Status Code: 200

Success

RoleBizModel

[GET] /api/v2/identity/roles/me/non-org-roles

Get all the global roles of the current logged in user.

Parameters

Name Type Located In Description
all Boolean query Whether retrieve all global roles, only take effect when the current logged in user is a system administrator. For example: false

Response

Status Code: 200

Success

RoleBizModel

[GET] /api/v2/identity/roles/{id}

Get role information by id.

Parameters

Name Type Located In Description
idRequired string path The role id.
includePermission Boolean query Whether retrieve the permissions of the specified role. For example: true

Response

Status Code: 200

Success

RoleBizModel

Status Code: 404

Not Found

ApiErrorResult

[DELETE] /api/v2/identity/roles/{id}

Delete an role.

Parameters

Name Type Located In Description
idRequired string path The role id.

Response

Status Code: 204

No Content

Status Code: 400

Bad Request

ApiErrorResult

Status Code: 404

Not Found

ApiErrorResult

[GET] /api/v2/identity/roles/{id}/users

Get all users who belong to the specified role.

Parameters

Name Type Located In Description
idRequired string path The role id.

Response

Status Code: 200

Success

UserBizModel

Status Code: 404

Not Found

ApiErrorResult

[POST] /api/v2/identity/roles/{id}/users

Add users to the specified role.

Parameters

Name Type Located In Description
idRequired string path The role id.

Request Schema

RoleUsersUpdateModel

Response

Status Code: 200

Success

UserBizModel

Status Code: 400

Bad Request

ApiErrorResult

Status Code: 404

Not Found

ApiErrorResult

[PUT] /api/v2/identity/roles/{id}/users

Update the users who belong to the specified role.

Parameters

Name Type Located In Description
idRequired string path The role id.

Request Schema

RoleUsersUpdateModel

Response

Status Code: 200

Success

UserBizModel

Status Code: 400

Bad Request

ApiErrorResult

Status Code: 404

Not Found

ApiErrorResult

[DELETE] /api/v2/identity/roles/{id}/users/{userId}

Remove the specified user who belongs to the specified role.

Parameters

Name Type Located In Description
idRequired string path The role id.
userIdRequired string path The user id.

Response

Status Code: 204

No Content

Status Code: 400

Bad Request

ApiErrorResult

Status Code: 404

Not Found

ApiErrorResult

[GET] /api/v2/identity/roles/{id}/permissions

Get the permissions of the specified role.

Parameters

Name Type Located In Description
idRequired string path The role id.

Response

Status Code: 200

Success

PermissionModel

Status Code: 404

Not Found

ApiErrorResult

[POST] /api/v2/identity/roles/{id}/permissions

Update the permissions of the specified role.

Parameters

Name Type Located In Description
idRequired string path The role id.

Request Schema

RolePermissionsUpdateModel

Response

Status Code: 200

Success

PermissionModel

Status Code: 400

Bad Request

ApiErrorResult

Status Code: 404

Not Found

ApiErrorResult

[POST] /api/v2/identity/roles/import

Import roles.

Request Schema

RolesImportModel

Response

Status Code: 200

Success

RoleBizModel

Status Code: 400

Bad Request

ApiErrorResult

Models

Ƭ SearchType

Enum:

  • None
  • Count

The search type for searching records.

* None - 0 - Normal search.
* Count - 1 - Only retrieve the records count.

Ƭ RoleBizModel

Name Type Description Example
idNullable string The unique identity of the role. "972B2A4C-8C61-4E3B-AD3D-6E889FE8D761"
nameNullable string The name of the role. "DataManager"
creatorIdNullable string The creator id of the role. "CF61388C-D7CD-4A61-8FB3-A8A0B6915F3E"
createTime ISO DateTime Sting The creation time of the role. "2000-01-01 00:00:00.000"
isBuiltin Boolean Whether it is a built-in role.
allowEditPermissions Boolean Whether allow to edit the permissions of the role. true
permissionsNullable Array<string> The permissions of the role. ["view-report","view-dashboard"]
membersNullable Array<string> The member id list of the role. ["CD079B35-4A56-4F42-845D-726B09E08EA9","EAAA677A-7B0A-4471-99F0-4C3F1D31738C"]
tenantIdNullable string The id of the organization to which the role belongs. "D6FD678D-45B5-4222-BA81-58BE2E578F91"

Ƭ RoleModel

Name Type Description Example
idNullable string
nameNullable string
creatorIdNullable string
createTime ISO DateTime Sting
isBuiltin Boolean
allowEditPermissions Boolean
tenantIdNullable string
creator UserModel
userRolesNullable UserRoleModel
permissionsNullable RolePermissionModel
tenant TenantModel

Ƭ UserModel

Name Type Description Example
idNullable string
usernameNullable string
passwordHashNullable string
emailNullable string
mobileNullable string
providerIdNullable string
avatarNullable string
firstNameNullable string
lastNameNullable string
creationTime ISO DateTime Sting
enabled Boolean
fullNameNullable string
organizationIdPathNullable string
userRolesNullable UserRoleModel
userGroupsNullable UserGroupModel
userPropertiesNullable UserPropertyModel
extraClaimsNullable UserClaimModel
userTenantsNullable UserTenantModel
userAvatar UserAvatarModel

Ƭ UserRoleModel

Name Type Description Example
userIdNullable string
roleIdNullable string
user UserModel
role RoleModel

Ƭ RolePermissionModel

Name Type Description Example
roleIdNullable string
permissionNameNullable string
role RoleModel

Ƭ TenantModel

Name Type Description Example
idNullable string
name string
descriptionNullable string
enabled Boolean
parentTenantIdNullable string
pathNullable string
order int32
createTime ISO DateTime Sting
parentTenant TenantModel
tenantPropValuesNullable TenantPropValueModel
userTenantsNullable UserTenantModel
tenantRolesNullable RoleModel
tenantSettingsNullable TenantSettingModel
tenantPropRestrictionsNullable TenantPropRestrictionModel

Ƭ UserGroupModel

Name Type Description Example
groupIdNullable string
userIdNullable string
group GroupModel
user UserModel

Ƭ UserPropertyModel

Name Type Description Example
idNullable string
userId string
propertyId string
propertyValueNullable string
user UserModel
property CustomizePropertyModel

Ƭ UserClaimModel

Name Type Description Example
nameNullable string
valueNullable string
userIdNullable string
user UserModel

Ƭ UserTenantModel

Name Type Description Example
userId string
tenantId string
user UserModel
tenant TenantModel

Ƭ UserAvatarModel

Name Type Description Example
userIdNullable string
imageNullable string
lastModified ISO DateTime Sting
user UserModel

Ƭ GroupModel

Name Type Description Example
idNullable string
nameNullable string
creatorIdNullable string
creationTime ISO DateTime Sting
parentGroupIdNullable string
pathNullable string
parentGroup GroupModel
creator UserModel
userGroupsNullable UserGroupModel

Ƭ CustomizePropertyModel

Name Type Description Example
idNullable string
nameNullable string
showInList Boolean
allowUserEdit Boolean
multivalued Boolean
showInProfile Boolean
availableValuesNullable CustomizePropertyAvailableValueModel
userPropertiesNullable UserPropertyModel

Ƭ CustomizePropertyAvailableValueModel

Name Type Description Example
customizePropertyIdNullable string
valueNullable string
customizeProperty CustomizePropertyModel

Ƭ TenantPropValueModel

Name Type Description Example
idNullable string
tenantId string
tenantPropId string
valueNullable string
tenant TenantModel
tenantProp TenantPropModel

Ƭ TenantSettingModel

Name Type Description Example
idNullable string
tenantIdNullable string
pluginKeyNullable string
settingsGroupKeyNullable string
settingsNullable string
tenant TenantModel
settingsTextNullable string

Ƭ TenantPropRestrictionModel

Name Type Description Example
tenantId string
tenantPropId string
allowSubTenantEditing Boolean
allowSubTenantViewing Boolean
tenant TenantModel
tenantProp TenantPropModel

Ƭ TenantPropModel

Name Type Description Example
idNullable string
name string
descriptionNullable string
required Boolean
valueType TenantPropValueType
multivalued Boolean
tenantpropRestrictionsNullable TenantPropRestrictionModel
tenantPropValuesNullable TenantPropValueModel

Ƭ TenantPropValueType

Enum:

  • Text
  • Boolean
  • Number
  • Password

The value type of the organization property.

* Text - 0 - A normal string.
* Boolean - 1 - A boolean value.
* Number - 2 - A number.
* Password - 3 - A string used as a password.

Ƭ ApiErrorResult

The model used to describe all the errors that occurred when processing a web request.

Name Type Description Example
errorsNullable ApiError The errors list.

Ƭ ApiError

The model used to describe an error that occurred when processing a web request.

Name Type Description Example
codeNullable string The unique identity of the error.
messageNullable string The description text of the error.
contextNullable string Some related context information of the error.

Ƭ UserBizModel

Name Type Description Example
idNullable string
usernameNullable string
emailNullable string
mobileNullable string
providerNullable string
avatarNullable string
firstNameNullable string
lastNameNullable string
creationTime ISO DateTime Sting
status UserStatus
fullNameNullable string
organizationIdPathNullable string
rolesNullable Array<string>
customizePropertiesNullable Array<string>
extraClaimsNullable string
tenantRolesNullable Array<string>

Ƭ UserStatus

Enum:

  • Normal
  • Disabled

The status of user.

* Normal - 1 - Normal status.
* Disabled - 2 - Disabled status.

Ƭ RoleUsersUpdateModel

Name Type Description Example
userIds Array<string> The user ids list. ["F00FC3E6-8554-467D-9A7E-4598E623BB2F","8259E551-5AFB-489E-8593-0FD6384E123B"]

Ƭ PermissionModel

Name Type Description Example
nameNullable string
descriptionNullable string
enabled Boolean
order int32
moduleNullable string
categoryNullable string
isCustomPermission Boolean

Ƭ RolePermissionsUpdateModel

Name Type Description Example
permissions Array<string> Permissions list. ["view-dashboard","view-report"]

Ƭ RolesImportModel

Name Type Description Example
roles RoleBizModel The roles list.