GetByPermissionServiceOrg [UserManager]

Get a list of users for a given service by a specific permission and organization

Description

The GetByPermissionServiceOrg() method is used to get a list of users associated to a specific service by a specific permission and organization provided.

Package Details

Interface

IUserManager

Syntax

await UserManager.GetByPermission(int permisssionId, int serviceId, int? organizationId)

Returns

Task<ICollection<User>>

API

GET
/api/v1/permissions/{permissionId}/services/{serviceid}?organizationId={organizationId}

Parameters

Parameter

Description

Parameter Type

Parameter

Description

Parameter Type

permissionId

Permission Id

Path

serviceId

Service Id

Path

organizationId (Optional)

Specific the organization Id to return users matching service and permission in that organization

Query string

Returns

On success, 200 Ok

If UserManage.GetByPermissionServiceOrg returns null, 422 Unprocessable Entity

On error, 400 Bad Request

On authorization error, 403 Forbidden

Example

int permissionId = 1; int serviceId = 2; var users = await _userManager.GetByPermissionServiceOrg(permissionId, serviceId);

 

int permissionId = 1; int serviceId = 2; int organizationId = 41; var users = await _userManager.GetByPermissionServiceOrg(permissionId, serviceId, organizationId);