Roles & Permissions
Understand how roles and permissions work in ARSAKA PUGUH.
Role-Based Access Control (RBAC)
PUGUH uses RBAC to manage what users can do. Each user has exactly one role per organization, and roles define their permissions.
Built-in Roles
Owner
The highest level of access. Each organization has exactly one owner.
Capabilities:
- All permissions
- Billing and subscription management
- Delete organization
- Transfer ownership
Admin
Full management access without billing.
Capabilities:
- Create, edit, delete all resources
- Manage users and roles
- Configure organization settings
- Cannot access billing
- Cannot delete organization
Member
Standard user for day-to-day work.
Capabilities:
- Create and manage webhooks
- View all resources
- Cannot delete resources
- Cannot manage users
Viewer
Read-only access for observers.
Capabilities:
- View all resources
- Cannot make any changes
- Cannot create or modify resources
Permission System
Permissions follow the format:
{domain}.{resource}.{action} Examples
| Permission | Meaning |
|---|---|
webhook.endpoints.create | Create webhook endpoints |
webhook.endpoints.delete | Delete webhook endpoints |
iam.users.invite | Invite new users |
organization.settings.update | Update organization settings |
control.audit.view | View audit logs |
Domain List
| Domain | Resources |
|---|---|
iam | users, roles, permissions, service-accounts |
organization | settings, members, applications |
webhook | endpoints, deliveries |
control | audit, events, metrics, dlq |
billing | subscription, invoices, payment-methods |
storage | files, buckets |
Permission Matrix
Navigate to IAM > Permissions to see the full permission matrix.
- All available permissions
- Which roles have which permissions
- Effective permissions for each user
Custom Roles (Pro/Enterprise)
Pro and Enterprise plans can create custom roles with specific permissions.
Creating a Custom Role
- Go to IAM > Roles
- Click "Create Role"
- Enter role name and description
- Select permissions to include
- Click "Create"
Custom Role Examples
Webhook Manager Role
webhook.endpoints.viewwebhook.endpoints.createwebhook.endpoints.updatewebhook.endpoints.deletewebhook.deliveries.view
Application Manager Role
organization.applications.vieworganization.applications.createorganization.applications.updateorganization.applications.delete
Auditor Role
control.audit.viewcontrol.events.viewcontrol.metrics.view
Role Inheritance
PUGUH uses a flat role model - roles don't inherit from each other. Each role explicitly defines its permissions.
This means:
- No hidden permissions from parent roles
- Easy to understand what each role can do
- No complex inheritance chains
API Permission Checks
When making API calls, permissions are checked:
// This will fail if user lacks webhook.endpoints.create
const response = await client.webhooks.create({
url: 'https://example.com/hook',
eventTypes: ['organization.created'],
});
// Error response if lacking permission:
// { "error": "PERMISSION_DENIED", "message": "Missing permission: webhook.endpoints.create" } Checking Permissions in Code
import { PuguhClient } from '@arsaka/puguh-sdk';
// Check if user has a specific permission
const canCreate = await client.hasPermission('webhook.endpoints.create');
if (canCreate) {
// Show create button
}
// Get all user permissions
const permissions = await client.getPermissions();
console.log(permissions);
// ['webhook.endpoints.view', 'webhook.endpoints.create', ...] Best Practices
- Start Restricted: Use Viewer role by default, upgrade as needed
- Review Regularly: Audit who has what access quarterly
- Document Custom Roles: Keep notes on why custom roles were created
- Use Service Accounts: Don't give API keys to Admin users
- Separate Concerns: Different roles for different responsibilities
Troubleshooting
"Permission Denied" Errors
If a user sees permission errors:
- Check their role in IAM > Users
- Verify the role has the required permission in IAM > Roles
- Ensure they're in the correct organization
- Check if they're suspended
Cannot Change Owner
Ownership transfer requires:
- Current owner initiates transfer
- New owner accepts
- New owner must be an Admin