Permit Support Automation
08/07/2025, 1:02 AMJannis Köksel
08/08/2025, 1:44 PMPermit Support Automation
08/08/2025, 8:24 PMPermit Support Automation
08/10/2025, 9:58 AMPermit Support Automation
08/10/2025, 10:52 AMPermit Support Automation
08/11/2025, 8:51 AMPermit Support Automation
08/11/2025, 8:56 AMSrinivas Medam
08/11/2025, 10:56 AMPermit Support Automation
08/11/2025, 8:43 PMPermit Support Automation
08/11/2025, 8:54 PMPermit Support Automation
08/12/2025, 4:27 PMPermit Support Automation
08/12/2025, 5:17 PMSuhas Kelkar
08/12/2025, 5:21 PMPermit Support Automation
08/12/2025, 5:51 PMPermit Support Automation
08/13/2025, 1:53 AMPermit Support Automation
08/13/2025, 11:18 AMPermit Support Automation
08/13/2025, 1:53 PMPermit Support Automation
08/13/2025, 7:05 PMPermit Support Automation
08/13/2025, 7:15 PMPermit Support Automation
08/13/2025, 8:44 PMPouya Xo
08/14/2025, 7:45 AM<mailto:test-user5@test.com|test-user5@test.com>
• Assigned Role: Manager
• User Attributes:
◦ `location`: "USA"
◦ `department`: "Eng"
Resource Configuration
• Resource Type: Services
• Resource Attributes:
◦ `cost`: numeric value
◦ `hasApproval`: boolean
User Set Definition
Engineer Managers in USA:
{
"allOf": [
{
"allOf": [
{
"user.location": {
"equals": "USA"
}
},
{
"user.department": {
"equals": "Eng"
}
}
]
}
]
}
Resource Sets
Services Above $500:
{
"allOf": [
{
"allOf": [
{
"resource.hasApproval": {
"equals": true
}
},
{
"resource.cost": {
"greater-than-equals": 500
}
}
]
}
]
}
Services Below $500:
{
"allOf": [
{
"allOf": [
{
"resource.cost": {
"less-than": 500
}
},
{
"resource.hasApproval": {
"equals": true
}
}
]
}
]
}
Code Implementation
const serviceCost = 400;
const userEmail = "test-user5@test.com";
const userLocation = "USA";
const userDepartment = "Eng";
const serviceApproval = "true";
const checkPermission = async () => {
setIsLoading(true);
setError(null);
try {
const response = await fetch("/api/permit/check", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
user: {
key: userEmail,
attributes: {
location: userLocation,
department: userDepartment,
},
},
action: "subscribe",
resource: {
type: "services",
attributes: {
hasApproval: serviceApproval,
cost: serviceCost,
},
tenant: "default",
},
}),
});
if (!response.ok) {
throw new Error(HTTP error! status: ${response.status}
);
}
const result = await response.json();
setIsAllowedToSubscribe(result.permitted);
} catch (err) {
setError(
err instanceof Error ? err.message : "Failed to check permission",
);
} finally {
setIsLoading(false);
}
};
```
The Problem
Main Issue: Permission is always denied when using user sets and resource sets together. The system only works when I assign permissions directly to the user's role and specific resources.
Error Scenarios
Scenario 1: "No User Roles" Error
Sometimes I get this error even though the user IS assigned to a role:
{
"__data_use_debugger": true,
"__input_use_debugger": true,
"allow": false,
"allowing_sources": [],
"debug": {
"rbac": {
"allow": false,
"code": "no_user_roles",
"reason": "no roles assigned to user 'test-user5@test.com'",
"support_link": "https://docs.permit.io/errors/no_user_roles"
},
"request": {
"action": "subscribe",
"resource": {
"attributes": {
"cost": 400,
"hasApproval": "true",
"type": "services"
},
"type": "services"
},
"tenant": null,
"user": {
"attributes": {
"department": "Eng",
"location": "USA",
"roles": [],
"tenants": []
},
"key": "test-user5@test.com",
"synced": false
}
}
},
"debugger_activated": true
}
Workaround: Deleting and recreating the user with role assignment temporarily fixes this.
Scenario 2: "No Permission" Error
After recreating the user, I get this error indicating the system isn't matching the user to the user set:
{
"__data_use_debugger": true,
"__input_use_debugger": null,
"allow": false,
"allowing_sources": [],
"debug": {
"rbac": {
"allow": false,
"code": "no_permission",
"reason": "user 'test-user5@test.com' does not have any role that grants him the 'subscribe' permission on resources of type 'services'",
"support_link": "https://docs.permit.io/errors/no_permission"
},
"request": {
"action": "subscribe",
"resource": {
"attributes": {
"cost": 400,
"hasApproval": "true",
"type": "services"
},
"type": "services"
},
"tenant": null,
"user": {
"attributes": {
"department": "Eng",
"email": "test-user5@test.com",
"key": "test-user5@test.com",
"location": "USA",
"roles": [
"Admin"
],
"tenants": [
"default"
]
},
"key": "test-user5@test.com",
"synced": true
}
}
},
"debugger_activated": true
}
Environment
• PDP running on Docker
• Direct role-to-resource permissions work fine
• Issue only occurs with user set + resource set combinations
Questions
1. Is there a known issue with user sets and resource sets working together?
2. Why does the system sometimes not recognize assigned roles?
3. Are there any configuration steps I might be missing for ABAC setup?
4. Is there a way to debug why the user isn't being matched to the user set?
Any insights or suggestions would be greatly appreciated! Has anyone encountered similar issues with ABAC implementations?
Thanks in advance! 🙏Permit Support Automation
08/15/2025, 2:14 AMAbe Clark
08/15/2025, 2:30 AMYoong Jia
08/15/2025, 5:47 AMpermit.getUserPermissions(id)
through the sdk, and it will return a full list of permission to the front end to render the items.
Previously when we changed the roles of a user, the changes in the permission returned from that call also happens near real-time/immediately, but starting yesterday the getUserPermissions
only returns the correct permission after around 5 mins approximately (different every time) after we changed the roles. Do you know why ? It looks like the rendering of the roles on permit.io side has some issue and propagation of the policy to our PDP is delayedPermit Support Automation
08/15/2025, 10:01 AMAbe Clark
08/15/2025, 11:41 PMsrc="<https://embed.permit.io/workspace?envId=ABC&resourceInstance=DEF>"
Feels like it would go as a url param? I tried a few different options but the resulting request always ended up with resource_instance_id=null
Abe Clark
08/16/2025, 12:13 AMPermit Support Automation
08/16/2025, 7:24 AMPermit Support Automation
08/16/2025, 7:34 AMPermit Support Automation
08/17/2025, 12:48 PM