Creating a policy to permit or deny the creation of resources
This policy allows the creation of one resource type but not another. In particular, the policy focuses on the create action and then allows the creation of Device resources but denies the creation of User resources.
Steps
-
In the Policy Editor, go to Policies in the left pane and then click Policies along the top.
-
From the menu, select Add Policy.
-
For the name, replace Untitled with
User can only create Device resources
. -
Click the next to Applies to.
-
Click Add definitions and targets, or drag from Components and add the create action.
-
Set Combining Algorithm to Unless one decision is deny, the decision will be permit.
-
Add a rule to allow the creation of Device resources.
-
Click Add Rule.
-
For the name, replace Untitled with
Permit the creation of Device resources
. -
Click Comparison.
-
In the first field, click the A to toggle to an R, and from that field’s drop-down list, select Service.
-
In the second field, select Equals.
-
In the third field, select the SCIM2.Devices service.
-
Click Save changes.
You should have a screen similar to the following one for the policy and this rule.
-
-
Add a rule to deny the creation of User resources.
-
Click Add Rule.
-
For the name, replace Untitled with
Deny the creation of User resources
. -
Set Effect to Deny.
-
Click Comparison.
-
In the first field, click the A to toggle to an R, and from that field’s drop-down list, select Service.
-
In the second field, select Equals.
-
In the third field, select the SCIM2.Users service.
-
Add statements to provide a custom message.
-
Within the rule, click Show Statements.
-
Click next to Statements.
-
Click Add Statement → Denied Reason.
-
For the name, specify
denied-reason
. -
Set Applies To to Deny.
-
In the Payload field:
-
Remove
Example:
-
Change
Human-readable error message
to
System has restricted the ability to create User resources
-
-
-
Click Save changes.
You should have a screen similar to the following one for the second rule.
-
-
Send test requests to the SCIM service and verify data using the Policy Editor’s Decision Visualiser.