role_permissions
Creates, updates, deletes, gets or lists a role_permissions resource.
Overview​
| Name | role_permissions |
| Type | Resource |
| Id | okta.iam.role_permissions |
Fields​
The following fields are returned by SELECT queries:
- get_role_permission
- list_role_permissions
| Name | Datatype | Description |
|---|---|---|
_links | object | Specifies 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. |
conditions | object | Conditions for further restricting a permission. See Permission conditions. |
created | string (date-time) | Timestamp when the permission was assigned |
label | string | The assigned Okta permission (example: okta.users.read) |
lastUpdated | string (date-time) | Timestamp when the permission was last updated |
| Name | Datatype | Description |
|---|---|---|
permissions | array | Array of permissions assigned to the role. See Permissions. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_role_permission | select | roleIdOrLabel, permissionType, subdomain | Retrieves a permission (identified by permissionType) for a custom role | |
list_role_permissions | select | roleIdOrLabel, subdomain | Lists all permissions for a custom role by roleIdOrLabel | |
create_role_permission | insert | roleIdOrLabel, permissionType, subdomain | Creates a permission (specified by permissionType) for a custom role | |
replace_role_permission | replace | roleIdOrLabel, permissionType, subdomain | Replaces a permission (specified by permissionType) for a custom role | |
delete_role_permission | delete | roleIdOrLabel, permissionType, subdomain | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
permissionType | string | An Okta permission |
roleIdOrLabel | string | id or label of the role |
subdomain | string | (default: my-org) |
SELECT examples​
- get_role_permission
- list_role_permissions
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
;
Lists all permissions for a custom role by roleIdOrLabel
SELECT
permissions
FROM okta.iam.role_permissions
WHERE roleIdOrLabel = '{{ roleIdOrLabel }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
INSERT examples​
- create_role_permission
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: role_permissions
props:
- name: roleIdOrLabel
value: "{{ roleIdOrLabel }}"
description: Required parameter for the role_permissions resource.
- name: permissionType
value: "{{ permissionType }}"
description: Required parameter for the role_permissions resource.
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the role_permissions resource.
- name: conditions
description: |
Conditions for further restricting a permission. See [Permission conditions](https://help.okta.com/okta_help.htm?type=oie&id=ext-permission-conditions).
value:
exclude: "{{ exclude }}"
include: "{{ include }}"
REPLACE examples​
- replace_role_permission
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​
- delete_role_permission
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
;