Thillai
08/28/2025, 7:01 AMpermit.check() expects a user_id as the subject, and evaluates permissions based on that user’s assigned roles/policies.
Is there a supported way to directly check permissions for a role (e.g. "admin") without going through a user? Or should we always create a test user with that role when we want to validate role-based access? Thanks.Ask Inkeep
08/28/2025, 7:01 AMAsk Inkeep
08/28/2025, 7:01 AMpermit.check() requires a user identifier as the first argument (1) . The function signature is:
permitted = await permit.check("<mailto:john@smith.com|john@smith.com>", "create", "document")
The SDK is designed to check permissions for specific users, not roles directly . The check evaluates whether a particular user (identified by their unique key) can perform an action on a resource.
The documentation doesn't show a method to directly check permissions for a role without a user context. Creating a test user with the desired role would be the standard approach to validate role-based permissions, as the authorization model evaluates permissions based on the roles assigned to specific users.Ask Inkeep
08/28/2025, 7:01 AMAlon Boshi
08/28/2025, 7:04 AMThillai
08/28/2025, 7:12 AMAbe Clark
08/28/2025, 7:39 AMOr Weis
08/28/2025, 7:53 AMOr Weis
08/28/2025, 7:58 AMAbe Clark
08/28/2025, 8:55 AM