Permit Support Automation
08/28/2025, 1:24 PMAsk Inkeep
08/28/2025, 1:24 PMAsk Inkeep
08/28/2025, 1:25 PMcreate method (2) (3) :
await permit.api.conditionSets.create({
key: "blocked_users",
name: "Blocked Users",
type: "userset",
conditions: {
allOf: [{ allOf: [{ "user.blocked": { equals: true } }] }],
},
}) ;
(3)
For resource sets:
await permit.api.conditionSets.create({
key: "owned_plans",
name: "Owned Plans",
type: "resourceset",
resource_id: "plan",
conditions: {
allOf: [
{ allOf: [{ "resource.owner": { equals: { ref: "user.key" } } }] },
],
},
}) ;
Ruby SDK Example
For Ruby, you can use the create_condition_set method (4) :
api_instance = OpenapiClient::ConditionSetsApi.new
proj_id = 'proj_id_example' # String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\") .
env_id = 'env_id_example' # String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\") .
condition_set_create = OpenapiClient::ConditionSetCreate.new # ConditionSetCreate |
begin
# Create Condition Set
result = api_instance.create_condition_set(proj_id, env_id, condition_set_create)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling ConditionSetsApi->create_condition_set: #{e}"
end
(5)
The condition sets use logical operators like allOf to combine multiple conditions (1) . You can then assign permissions to these condition sets in your policy rules (3) .Ask Inkeep
08/28/2025, 1:25 PM