OrganizationPermissions

Permissions

Role-based access control with granular repository, organization, and team permissions.

Drok's permission system is role-based, hierarchical, and auditable. Every action on the platform — from reading a file to deleting an organization — is governed by a permission that can be traced to a specific role assignment.

Organization Roles

RoleDescription
OwnerFull administrative control over the organization
AdminManage teams, repositories, and organization settings. Cannot delete the organization or manage billing.
MemberDefault role. Access repositories and teams per their specific permissions.
Billing ManagerManage subscription and payment. No code access.

Assigning Roles

drok org set-role my-org @alice --role admin

Repository Permissions

Repository access is granted through direct assignment or team membership:

PermissionClonePushIssuesMR MergeSettingsAdmin
ReadYesNoViewViewNoNo
TriageYesNoManageManage (no merge)NoNo
WriteYesYes (non-protected)ManageMerge (with approval)NoNo
MaintainYesYesManageMergeLimitedNo
AdminYesYesManageMergeFullYes

Direct Assignment

drok repo add-collaborator my-org/my-repo @alice --permission write

Through Teams

drok team add-repo my-org/backend my-org/my-repo --permission write

When a user has multiple permission grants (e.g., through multiple teams, or direct + team), the highest permission level applies.

Branch-Level Permissions

Fine-grained permissions can be applied at the branch level through branch protection rules. See Branch Protection for details.

Permission Inheritance

Permission inheritance follows this hierarchy:

  1. Organization role — Sets the baseline for all repositories in the organization
  2. Team membership — Grants additional access to repositories assigned to the team
  3. Direct repository assignment — Grants access to a specific repository
  4. Branch protection rules — Restricts actions on specific branches regardless of repository permission

Higher-level permissions do not override branch protection rules. An organization owner with admin access to a repository is still subject to branch protection requirements (required reviews, status checks) unless explicitly exempted.

Custom Roles (Enterprise)

Enterprise organizations can define custom roles with specific permission sets:

drok role create my-org/release-manager \
  --permissions repo:read,repo:write,tag:create,release:create,release:edit \
  --description "Can manage releases and tags"

Custom roles can be assigned to users and teams:

drok org set-role my-org @alice --role release-manager

API Scopes

Personal access tokens use scoped permissions:

ScopeAccess
repo:readRead repository content
repo:writePush to repositories
repo:adminRepository administration
org:readRead organization info
org:adminOrganization administration
package:readRead packages
package:writePublish packages
user:readRead user profile
user:writeModify user profile
audit:readRead audit logs

Creating Tokens

drok token create --name "ci-deploy" --scopes repo:read,package:write --expiry 90d

Tokens can be scoped to specific repositories:

drok token create --name "repo-specific" --scopes repo:write --repos my-org/my-repo

Auditing

Every permission change is recorded in the organization audit log:

drok audit-log my-org --filter "action:permission.*"

See Audit Log for details.