Overview
The K8s Scheduler implements a comprehensive RBAC (Role-Based Access Control) system with two hierarchical levels: Organization and Team. Each level has distinct roles with specific permissions.RBAC Hierarchy
Organization Roles
org_owner
The organization owner has complete control over the organization. Permissions:- ✅ Full organization management
- ✅ Create, update, delete teams
- ✅ Manage all team members across all teams
- ✅ View and manage billing and subscriptions
- ✅ Create organization-wide templates
- ✅ Delete the organization
- ✅ All permissions of org_admin and org_member
- The user who creates the organization automatically becomes the owner
- Only one owner per organization
- Ownership can be transferred to another user
org_admin
Administrators can manage teams and members without full ownership. Permissions:- ✅ Create and manage teams
- ✅ Add/remove members from teams
- ✅ Assign team roles
- ✅ Create organization-level templates
- ✅ View organization details
- ❌ Cannot delete the organization
- ❌ Cannot manage billing
- ❌ Cannot transfer ownership
- Team leads who need to manage multiple teams
- Platform administrators
- HR personnel managing team memberships
org_member
Basic organization membership with access to assigned teams only. Permissions:- ✅ View organization details
- ✅ Access teams they are explicitly added to
- ✅ View team-level resources based on team role
- ❌ Cannot create teams
- ❌ Cannot see teams they’re not a member of
- ❌ Cannot manage organization settings
Most users will have the org_member role at the organization level, with specific team roles defining their actual permissions.
Team Roles
team_admin
Team administrators manage team members and resources. Permissions:- ✅ Invite and remove team members
- ✅ Change member roles within the team
- ✅ Create, update, delete deployments
- ✅ Create team-level templates
- ✅ Manage team secrets
- ✅ View deployment logs and metrics
- ❌ Cannot delete the team (requires org_admin or org_owner)
- Project managers
- Senior developers leading a project
- DevOps team leads
developer
Developers can create and manage deployments. Permissions:- ✅ Create deployments from templates
- ✅ Update and delete their own deployments
- ✅ View all team deployments
- ✅ Create deployment-specific secrets
- ✅ View deployment logs and metrics
- ✅ Create private templates
- ❌ Cannot manage team members
- ❌ Cannot create team-level templates
- Application developers
- DevOps engineers
- QA engineers who need to deploy test environments
viewer
Read-only access to team resources. Permissions:- ✅ View team deployments
- ✅ View deployment status and details
- ✅ View templates
- ❌ Cannot create or modify deployments
- ❌ Cannot view secrets (sensitive data)
- ❌ Cannot view logs (may contain sensitive info)
- ❌ Cannot manage team members
- Product managers
- Stakeholders who need visibility
- Junior team members in training
- Auditors
Permission Matrix
Organization Level
| Action | org_owner | org_admin | org_member |
|---|---|---|---|
| View organization | ✅ | ✅ | ✅ |
| Update organization details | ✅ | ✅ | ❌ |
| Delete organization | ✅ | ❌ | ❌ |
| Manage billing | ✅ | ❌ | ❌ |
| Create teams | ✅ | ✅ | ❌ |
| Delete teams | ✅ | ✅ | ❌ |
| View all teams | ✅ | ✅ | ❌ |
| Add org members | ✅ | ✅ | ❌ |
| Remove org members | ✅ | ✅ | ❌ |
| Create org templates | ✅ | ✅ | ❌ |
| Transfer ownership | ✅ | ❌ | ❌ |
Team Level
| Action | team_admin | developer | viewer |
|---|---|---|---|
| View team details | ✅ | ✅ | ✅ |
| View deployments | ✅ | ✅ | ✅ |
| Create deployments | ✅ | ✅ | ❌ |
| Update deployments | ✅ | ✅ (own) | ❌ |
| Delete deployments | ✅ | ✅ (own) | ❌ |
| View logs | ✅ | ✅ | ❌ |
| View metrics | ✅ | ✅ | ✅ |
| Manage secrets | ✅ | ✅ (own) | ❌ |
| View templates | ✅ | ✅ | ✅ |
| Create team templates | ✅ | ❌ | ❌ |
| Invite members | ✅ | ❌ | ❌ |
| Remove members | ✅ | ❌ | ❌ |
| Change member roles | ✅ | ❌ | ❌ |
“(own)” indicates the user can only perform the action on resources they created.
Authorization Flow
The authorization system uses a middleware-based approach:Implementation
Permission Definitions
Permissions are defined as resource-action pairs:Role Assignment
Assigning Organization Roles
Organization owners can assign org-level roles:Assigning Team Roles
Team admins and org admins can assign team roles:Default Role Assignment
New organization owner
New organization owner
When a user creates an organization:
- Organization role:
org_owner - Automatically added to a default team as
team_admin
Invited team member
Invited team member
When a user is invited to a team:
- Organization role:
org_member(if not already a member) - Team role: As specified in the invitation (default:
developer)
OAuth signup
OAuth signup
When a user signs up via OAuth:
- A new organization is created with the user as
org_owner - A default team is created with the user as
team_admin
API Examples
Check User Permissions
List Organization Members
Security Considerations
Principle of Least Privilege
Always grant users the minimum role required for their responsibilities. Start with viewer or developer, escalate only when necessary.
Regular Audits
Periodically review role assignments, especially org_owner and org_admin roles. Remove or downgrade inactive users.
Separation of Duties
Avoid giving the same user both org_owner and direct access to production deployments. Use team roles for deployment access.
Use Teams for Isolation
Create separate teams for different environments (dev, staging, prod) to limit blast radius of accidental changes.
Troubleshooting
Permission Denied Errors
If you receive a403 Forbidden response:
- Check your role: Verify your current roles with
GET /api/me/permissions - Verify team membership: Ensure you’re a member of the team you’re trying to access
- Check resource ownership: Some actions (like updating deployments) require ownership
- Review required permissions: Check the API documentation for the required permissions
Cannot See Expected Teams
If teams are missing from the UI:- You must be explicitly added to teams as an
org_member org_adminandorg_ownerroles see all teams automatically- Contact your organization admin to be added to the team
Cannot Invite Team Members
To invite members, you need:team_adminrole on the team, ORorg_adminororg_ownerrole in the organization
Related Documentation
Multi-Tenancy
Understanding the organizational hierarchy
API - Organizations
Organization and team management endpoints
Templates
Template visibility and permissions
Secrets Management
Secret access control and scoping