Skip to main content

role_permissions

Creates, updates, deletes, gets or lists a role_permissions resource.

Overview​

Namerole_permissions
TypeResource
Idokta.iam.role_permissions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
conditionsobjectConditions for further restricting a permission. See Permission conditions.
createdstring (date-time)Timestamp when the permission was assigned
labelstringThe assigned Okta permission (example: okta.users.read)
lastUpdatedstring (date-time)Timestamp when the permission was last updated

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_role_permissionselectroleIdOrLabel, permissionType, subdomainRetrieves a permission (identified by permissionType) for a custom role
list_role_permissionsselectroleIdOrLabel, subdomainLists all permissions for a custom role by roleIdOrLabel
create_role_permissioninsertroleIdOrLabel, permissionType, subdomainCreates a permission (specified by permissionType) for a custom role
replace_role_permissionreplaceroleIdOrLabel, permissionType, subdomainReplaces a permission (specified by permissionType) for a custom role
delete_role_permissiondeleteroleIdOrLabel, permissionType, subdomainDeletes a permission (identified by permissionType) from a custom role

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
permissionTypestringAn Okta permission
roleIdOrLabelstringid or label of the role
subdomainstring(default: my-org)

SELECT examples​

Retrieves a permission (identified by permissionType) for a custom role

SELECT
_links,
conditions,
created,
label,
lastUpdated
FROM okta.iam.role_permissions
WHERE roleIdOrLabel = '{{ roleIdOrLabel }}' -- required
AND permissionType = '{{ permissionType }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a permission (specified by permissionType) for a custom role

INSERT INTO okta.iam.role_permissions (
conditions,
roleIdOrLabel,
permissionType,
subdomain
)
SELECT
'{{ conditions }}',
'{{ roleIdOrLabel }}',
'{{ permissionType }}',
'{{ subdomain }}'
;

REPLACE examples​

Replaces a permission (specified by permissionType) for a custom role

REPLACE okta.iam.role_permissions
SET
conditions = '{{ conditions }}'
WHERE
roleIdOrLabel = '{{ roleIdOrLabel }}' --required
AND permissionType = '{{ permissionType }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
_links,
conditions,
created,
label,
lastUpdated;

DELETE examples​

Deletes a permission (identified by permissionType) from a custom role

DELETE FROM okta.iam.role_permissions
WHERE roleIdOrLabel = '{{ roleIdOrLabel }}' --required
AND permissionType = '{{ permissionType }}' --required
AND subdomain = '{{ subdomain }}' --required
;