Permissions¶
sentinel_auth.permissions
¶
Async HTTP client for checking permissions against the identity service.
PermissionClient(base_url, service_name, service_key=None)
¶
Client for the identity service's permission API.
Source code in sdk/src/sentinel_auth/permissions.py
check(token, checks)
async
¶
Batch check permissions. Pass the user's JWT as the token.
Source code in sdk/src/sentinel_auth/permissions.py
can(token, resource_type, resource_id, action)
async
¶
Convenience: check a single permission.
Source code in sdk/src/sentinel_auth/permissions.py
register_resource(resource_type, resource_id, workspace_id, owner_id, visibility='workspace')
async
¶
Register a new resource (service-key only, no user JWT needed).
Source code in sdk/src/sentinel_auth/permissions.py
share(token, resource_type, resource_id, grantee_type, grantee_id, permission='view')
async
¶
Share a resource with a user or group.
Looks up the permission record by resource coordinates, then shares.
Source code in sdk/src/sentinel_auth/permissions.py
accessible(token, resource_type, action, workspace_id, limit=None)
async
¶
Lookup accessible resource IDs for the current user.
Returns (resource_ids, has_full_access). When has_full_access is True and no limit was set, resource_ids is empty — the caller should skip filtering entirely.