CreateRole
Creates a new role.
Parameters
role
- An object that contains the information about the new role. The payload is defined below.
Payload
Key
- A URL-friendly name of the role (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the role.
Name
- The name of the role.
Description
- optional - The description string explaining what this role represents, or what permissions are granted to it.
Permissions
- optional - The list of action keys that define what actions this resource role is permitted to do.
Extends
- optional - The list of role keys that define what roles this role extends. In other words: this role will automatically inherit all the permissions of the given roles in this list.
{
Key: "editor",
Name: "Editor",
Description: "the editor role can read and write to documents",
Permissions: ["document:write"],
Extends: ["viewer"]
}
Implementation
var response = await permitClient.Api.CreateRole(role);