Cloudrive

Authorization

Who can do what — organization roles, workspace roles, and how handlers check them.

Every application route except the health check, the provider OAuth callback, and the auth endpoints requires a bearer token. On top of that, handlers check organization membership and, for writes, the role.

Roles

ScopeRolesWhere
Organizationowner, admin, memberorganization_members.role
Workspaceadmin, member, viewerworkspace_members.role
Globalsuper_user, userusers.role (from Authula metadata)

Creating an organization makes the caller its owner in the same transaction. Invitations can grant admin or member, never owner.

The check

requireOrgMember(c, app, orgID, userID, roles...) in internal/handlers/helpers.go:

  • not a member of the organization → 403 You do not have access to this organization;
  • roles given and the member's role is not in the list → 403 This action requires role: [...].

Workspace-scoped resources resolve the workspace first and check membership of its organization.

Permission matrix

ActionWho
Create an organizationAny signed-in user
List organizationsReturns only the caller's organizations
Read an organization, its members, invitations, workspacesAny organization member
Update an organizationowner, admin
Delete an organizationowner
Add, change, remove organization membersowner, admin
Create, update, delete invitationsowner, admin
Create, update, delete workspacesowner, admin
Read workspace membersAny organization member
Add, change, remove workspace membersOrg owner/admin, or workspace admin
Connect a storage account (direct or OAuth)owner, admin
List and read storage accounts, read quotaAny organization member
Update, rotate credentials, refresh, disconnectowner, admin
Create or revoke S3 credentials, create or delete bucketsowner, admin
List S3 credentials and buckets, browse drive, recent filesAny organization member
Submit the onboarding surveyAny signed-in user (one per user, upsert)

The frontend hides actions a role cannot perform, but that is cosmetic: the server is the only enforcement point.

On this page