Add() [UserServicePermissionManager]
Add user permission
Description
Add a user permission for a service.
Package Details
Interface
IUserServicePermissionManager
Syntax
await UserServicePermissionManager.Add(UserServicePermission);
Returns
Task<UserServicePermission>
API
POST
/api/v1/users/{id}/permissions
Parameters
Parameter | Description | Parameter Type |
---|---|---|
Id | The user's id | path |
User Service Permission | User Service Permission object | request body |
Sample request body
{
"PermissionId": 0,
"ServiceId": 0,
"OrganizationId": 0
}
Returns
200 OK - User Service Permission
Example
const int userId = 2757;
const int serviceId = 2;
const int permissionId = 3;
const int organizationId = 9999;
var newUserServicePermission = new UserServicePermission
{
PermissionId = permissionId,
UserId = userId,
ServiceId = serviceId,
OrganizationId = organizationId
};
var userServicePermission = await _userServicePermissionManager.Add(newUserServicePermission);