[]
        
(Showing Draft Content)

Identity-Role

Identity-Role

[GET] /api/v2/identity/roles

Parameters

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

Get all roles.

Responses

[200] Success

RoleBizModel

Type: [application/json]

[POST] /api/v2/identity/roles

Parameters

Name In Type Description
id query string The role id. If not specified, a new guid will be generated.
provider query string The role provider. If not specified, the default value is 'local'.

Add a new role.

Request Body

Description: The role name. For example: DataManager

Type: application/json

name

Responses

[201] Created

RoleBizModel

Type: [application/json]

[400] Bad Request

ApiErrorResult

Type: [application/json]

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

Parameters

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

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

Responses

[200] Success

RoleBizModel

Type: [application/json]

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

Parameters

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

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

Responses

[200] Success

RoleBizModel

Type: [application/json]

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

Parameters

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

Get role information by id.

Responses

[200] Success

RoleBizModel

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id

Update a role.

Request Body

Description: The role update model

Type: application/json

RoleUpdateModel

Responses

[200] Success

RoleBizModel

Type: [application/json]

[400] Bad Request

ApiErrorResult

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id.

Delete an role.

Responses

[204] No Content

[400] Bad Request

ApiErrorResult

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id.

Get all users who belong to the specified role.

Responses

[200] Success

UserBizModel

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id.

Add users to the specified role.

Request Body

Description: The role users update model.

Type: application/json

RoleUsersUpdateModel

Responses

[200] Success

UserBizModel

Type: [application/json]

[400] Bad Request

ApiErrorResult

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id.

Update the users who belong to the specified role.

Request Body

Description: The role users update model.

Type: application/json

RoleUsersUpdateModel

Responses

[200] Success

UserBizModel

Type: [application/json]

[400] Bad Request

ApiErrorResult

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

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

Remove the specified user who belongs to the specified role.

Responses

[204] No Content

[400] Bad Request

ApiErrorResult

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id.

Get the permissions of the specified role.

Responses

[200] Success

PermissionModel

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Parameters

Name In Type Description
idRequired path string The role id.

Update the permissions of the specified role.

Request Body

Description: The role permissions update model.

Type: application/json

RolePermissionsUpdateModel

Responses

[200] Success

PermissionModel

Type: [application/json]

[400] Bad Request

ApiErrorResult

Type: [application/json]

[404] Not Found

ApiErrorResult

Type: [application/json]

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

Import roles.

Request Body

Description: Role import model.

Type: application/json

RolesImportModel

Responses

[200] Success

RoleBizModel

Type: [application/json]

[400] Bad Request

ApiErrorResult

Type: [application/json]

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 display 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. false
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"
modifiedByNullable string The modifiedBy id of the role. "CF61388C-D7CD-4A61-8FB3-A8A0B6915F3E"
modifiedTime ISO DateTime Sting The modified time of the role. "2000-01-01 00:00:00.000"

Ƭ ApiErrorResult

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

Name Type Description
errorsNullable Array<ApiError> The errors list.

Ƭ ApiError

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

Name Type Description
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.

Ƭ RoleUpdateModel

Name Type
nameNullable string

Ƭ UserBizModel

Name Type
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
lastLoginTimeNullable ISO DateTime Sting
passwordChangeTimeNullable ISO DateTime Sting
passwordExpirationPolicy UserPasswordExpirationPolicy
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.

Ƭ UserPasswordExpirationPolicy

Enum:

  • FollowSystem
  • NeverExpire

Ƭ RoleUsersUpdateModel

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

Ƭ PermissionModel

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

Ƭ RolePermissionsUpdateModel

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

Ƭ RolesImportModel

Name Type Description
rolesRequired Array<RoleBizModel> The roles list.