PUT Security Roles

The PUT /Security/Roles method is used to update a security role in Keyfactor Command including the permissions set for the role and the security identities mapped to the role. This method returns HTTP 200 OK on a success with the details of the security role.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:

/security/modify/

The user must hold a role containing this permission in the Global Permission Set (see Permission Sets).

Important:  Any previously populated fields that are not submitted with their full existing data using this method will be cleared of their existing data. When using this method, you should first do a GET to retrieve all the values for the record you want to update, enter corrected data into the field(s) you want to update, and then submit all the fields using PUT, including the fields that contain values but which you are not changing.

This method has two available versions. Keyfactor strongly recommends using the newer method when possible; the v1 method has been deprecated since it supports Active Directory identities only. The v2 method has been redesigned to provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. This version of the method supports both Active Directory and other identity providers. For more information about versioning, see Versioning.

Version 2 of the PUT /Security/Roles method has been redesigned to provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. All new development should use this version.

Table 706: PUT Security Roles v2 Input Parameters

Name

In

Description
Id Body

Required. An integer containing the Keyfactor Command identifier for the security role.

Use the GET /Security/Roles method (see GET Security Roles) to retrieve a list of all the security roles to determine the role's ID.

Name Body Required. A string containing the short reference name for the security role.
Description Body Required. A string containing the description for the security role.
EmailAddress Body A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated)
Permission SetId Body

A string containing the Keyfactor Command reference GUID of the permission set to which the role is assigned (see Permission Sets).

Tip:  For details of the permissions associated with the role, use the GET /SecurityRoles/{id} method (see GET Security Roles ID) for the desired role. For details of the permissions associated withe the permission set to which the role belongs, use GET /PermissionSets/{id} method (see GET Permission Sets ID) using this permission set GUID. A role may be only granted a subset of the permissions available in a permission set.
Permissions Body

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Version Two Permission Model for an overview of the possible permissions.

For example:

Copy
"Permissions": [  
   "/portal/read/",
   "/dashboard/read/",
   "/certificates/collections/metadata/modify/6/",
   "/certificates/collections/private_key/read/6/"
],
Claims Body

An array of objects containing the claims associated with the role.

Table 707: PUT Security Roles v2 Response Data

Name Description
Id

An integer containing the Keyfactor Command identifier for the security role.

Name A string containing the short reference name for the security role.
Description A string containing the description for the security role.
EmailAddress A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated)
Immutable A Boolean indicating if the role is immutable or not. Only the built-in Administrators role is considered immutable. The value of this parameter cannot be changed.
Permission SetId

A string containing the Keyfactor Command reference GUID of the permission set to which the role is assigned (see Permission Sets).

Tip:  For details of the permissions associated with the role, use the GET /SecurityRoles/{id} method (see GET Security Roles ID) for the desired role. For details of the permissions associated withe the permission set to which the role belongs, use GET /PermissionSets/{id} method (see GET Permission Sets ID) using this permission set GUID. A role may be only granted a subset of the permissions available in a permission set.
Permissions

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Version Two Permission Model for an overview of the possible permissions.

For example:

Copy
"Permissions": [  
   "/portal/read/",
   "/dashboard/read/",
   "/certificates/collections/metadata/modify/6/",
   "/certificates/collections/private_key/read/6/"
],
Claims

An array of objects containing the claims associated with the role.

Tip:  See the Keyfactor API Reference and Utility which provides a utility through which the Keyfactor APIClosed endpoints can be called and results returned. It is intended to be used primarily for validation, testing and workflowClosed development. It also serves secondarily as documentation for the API. The link to the Keyfactor API Reference and Utility is in the dropdown from the help icon () at the top of the Management Portal page next to the Log Out button.