Ryan Barriger
08/12/2025, 5:55 PMAsk Inkeep
08/12/2025, 5:55 PMAsk Inkeep
08/12/2025, 5:55 PMAssignResourceRole method with the resource instance format (1) :
userRoleCreate := *models.NewUserRoleCreate(roleKey, tenantKey)
userRoleCreate.SetResourceInstance("document:mydoc")
user, httpRes, err := u.client.UsersApi.AssignRoleToUser(ctx, u.config.Context.GetProject() , u.config.Context.GetEnvironment() , userKey) .UserRoleCreate(userRoleCreate) .Execute()
The resource instance format is resource_type:instance_id (2) .
2. Check Permissions with Resource Instances
For the Check function, you don't pass the instance directly in the resource string. Instead, build the resource with the instance ID (3) :
user := enforcement.UserBuilder("<mailto:john@doe.com|john@doe.com>") .Build()
resource := enforcement.ResourceBuilder("document") .Build()
permitted, err := Permit.Check(user, "create", resource)
, (4)
However, based on the Mesa Verde demo application, when checking permissions for a specific instance, you would pass the resource with its attributes (5) :
const transactionAllowed = await permit.check(
{
key: user,
attributes: { strongAuth: !!OTP, location },
},
"create",
{
type: "Transaction",
attributes: { ...transaction },
tenant,
}
) ;
3. Unassign Resource Roles
To unassign a resource instance role (1) :
userRoleRemove := *models.NewUserRoleRemove(roleKey, tenantKey)
userRoleRemove.SetResourceInstance(resourceInstance)
user, httpRes, err := u.client.UsersApi.UnassignRoleFromUser(ctx, u.config.Context.GetProject() , u.config.Context.GetEnvironment() , userKey) .UserRoleRemove(userRoleRemove) .Execute()
The key is that resource instances follow the format resource_type:instance_id when assigning/unassigning roles (2) , but when checking permissions, you use the ResourceBuilder to construct the resource object (3) .
To help debug your issue, could you please provide:
1. Which Workspace / Project / Env you are using
2. What calls you are performing (as SDK code or CURL)
3. Which PDP version you are running
4. Relevant logs from your PDP
This will help our engineers investigate the "no resource found" error you're seeing in the Audit.Ask Inkeep
08/12/2025, 5:55 PMOr Weis
08/12/2025, 6:04 PMRyan Barriger
08/12/2025, 6:11 PMRyan Barriger
08/12/2025, 6:29 PMThomas
08/12/2025, 6:34 PMThomas
08/12/2025, 6:35 PMAsk Inkeep
08/12/2025, 6:35 PMAsk Inkeep
08/12/2025, 6:35 PMdocker pull permitio/pdp-v2:latest
Then run it with your API key :
docker run -it -p 7766:7000 --env PDP_DEBUG=True --env PDP_API_KEY=<YOUR_API_KEY> permitio/pdp-v2:latest
Once running, configure your Go SDK to point to the local PDP instead of the cloud PDP. The local PDP will listen on port 7766 and fully supports ReBAC policies including resource instances and relationship-based permissions (2) .
The Cloud PDP at <https://cloudpdp.api.permit.io> is great for quick experimentation but doesn't support ABAC or ReBAC policies (1) . For production deployments with ReBAC, using the Docker Container PDP provides better latency and full feature support .Ask Inkeep
08/12/2025, 6:35 PMRyan Barriger
08/12/2025, 6:38 PMRyan Barriger
08/12/2025, 6:38 PMThomas
08/12/2025, 6:43 PMThomas
08/12/2025, 6:43 PMThomas
08/12/2025, 6:44 PM