dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Organisation and Teams Management

Open vishalkadam47 opened this issue 1 year ago • 72 comments

What problem will this feature address?

User Roles & Permissions

  • [x] Introduce owner and admin roles (currently, only member role exists).
  • [ ] Add a custom user role with view-only access—users can only access assigned domains without creating project or deployment permissions. ( if required admin can allow start and stop container option)
  • [ ] Enable permission updates for each role.
  • [ ] Add the ability to transfer ownership.

Team Management

  • [ ] Implement Teams to group members within an organization.
  • [ ] Allow team-based invitations instead of inviting members individually (include an option to set a team size limit).
  • [ ] Enable the option to register new users.
  • [ ] Support adding descriptions for organizations and teams.
  • [ ] Allow deleting expired or cancelled invitations.
  • [ ] Provide an option to move members between teams.

Advanced Permissions & Access Control

  • [ ] Enable assigning specific remote servers to selected users or teams.
  • [ ] Introduce team-wide permissions to streamline access control for larger teams.

Describe the solution you'd like

A role-based access system with owner, admin, and a view-only user role, along with improved team management features like bulk invitations, team descriptions, and user movement between teams. Enhanced permission controls for assigning remote servers and granting team-wide access would streamline operations.

Describe alternatives you've considered

Currently, permissions and team management require manual configuration, which becomes inefficient as the organization scales. While we could continue with the existing setup, automating these processes with role-based access and team-wide permissions would significantly improve efficiency and security.

Additional context

No response

Will you send a PR to implement it?

Maybe, need help

vishalkadam47 avatar Mar 06 '25 00:03 vishalkadam47

here's the wip planned to Enable assigning specific remote servers to selected users or teams.

Image

vishalkadam47 avatar Mar 26 '25 07:03 vishalkadam47

I would like to add a small bounty for this.

/bounty $50

looks like Algora is not creating a bounty

vishalkadam47 avatar May 31 '25 21:05 vishalkadam47

I implemented a focused slice for the unchecked "Add the ability to transfer ownership" item in #4424.

Summary of the slice:

  • adds an owner-only organization.transferOwnership mutation
  • updates organization.ownerId, promotes the target member to owner, and demotes the previous owner to admin in one transaction
  • adds the guarded Users table action and audit metadata

Validation I ran locally:

  • corepack pnpm exec biome check apps/dokploy/server/api/routers/organization.ts apps/dokploy/components/dashboard/settings/users/show-users.tsx apps/dokploy/components/dashboard/settings/users/change-role.tsx
  • corepack pnpm --filter=dokploy exec tsc --noEmit --pretty false
  • git diff --check

The PR was auto-closed by the anti-slop workflow due to account-level heuristics (username/fork/profile/global merge ratio), not due to code or validation failures. I will not keep opening duplicates, but if this focused ownership-transfer slice is useful for #1413, maintainers can inspect/reopen #4424 or tell me what scope you want instead.

Treasure520520 avatar May 19 '26 05:05 Treasure520520

Implementation plan for a focused #1413 slice: add an admin/owner-accessible cleanup action for invitations that are no longer actionable, specifically expired or canceled invitations. I am keeping this scoped to the active organization, reusing the existing member-create permission gate, adding audit metadata, and exposing the cleanup from the existing Invitations table with a destructive confirmation. I will submit a PR with /claim #1413 after format/type validation passes.

manuelsampedro1 avatar May 19 '26 06:05 manuelsampedro1

/attempt #1413

Implementation plan: I will keep this to a focused safe slice of the larger organization/teams bounty: add editable organization descriptions using the existing organization metadata field, expose it through the existing create/update organization dialog, preserve unknown metadata keys, and include audit metadata plus local lint/type validation. If this overlaps with another active PR I will step back.

realkoreanbeef avatar May 19 '26 06:05 realkoreanbeef

/attempt #1413

I’m taking a focused non-overlapping slice: add a built-in view-only user role for organization members. Scope: register the static role in Better Auth, expose it in invite/change-role UI, allow it in role validation, reserve the built-in name from Enterprise custom roles, and add permission tests proving users can read assigned services/domains/deployments/logs/monitoring but cannot create projects/deployments/domains or inherit member legacy overrides.

nexicturbo avatar May 19 '26 12:05 nexicturbo

Follow-up: I submitted PR #4428 with /claim #1413 for this focused view-only user role slice. Local validation passed (Biome check, focused permission tests, tsc, diff check), but the repository anti-slop workflow auto-closed it due account/profile heuristics and PR description code-reference count, not maintainer review or test failure. I will not open duplicate PRs into the same workflow gate; maintainers can inspect/reopen #4428 if this slice is useful.

nexicturbo avatar May 19 '26 12:05 nexicturbo

/attempt #1413

I have a focused, validated patch for stale invitation cleanup:

  • restrict Remove Invitation to expired or non-pending invitations
  • keep active pending invitations on the cancel flow and enforce that server-side
  • add destructive confirmation/error handling
  • add unit coverage

I noticed @manuelsampedro1 outlined a similar cleanup slice earlier, and I do not want to step on active work. If they already have a PR in progress, I am happy to step back or collaborate. If not, I am opening the PR against canary with validation details and a short demo video.

nussann avatar May 19 '26 23:05 nussann

Hi! I’m interested in helping with this bounty, but I noticed there have already been several attempts and related PRs.

Before I start, could a maintainer confirm whether there is still a small, unclaimed part of this issue that would be useful?

I’d prefer to work on a narrow, non-overlapping slice rather than duplicate existing work.

If there is a remaining piece you’d like handled, I can open a focused PR for that specific scope.

Dude124 avatar May 19 '26 23:05 Dude124

Hi, I’m interested in working on this bounty, but the full scope seems larger than $100 because it touches organizations, teams, invites, ownership transfer, roles, and server-level permission enforcement.

Would a narrowed first slice qualify for the bounty?

For example:

  1. Basic organization roles: owner/admin/view-only, with UI + backend checks for existing organization pages.
  2. Organization metadata + member role management only, without team-level server access control.
  3. Team creation/member assignment UI only, leaving deeper permission enforcement for a later issue.

I can inspect the current structure and open a focused PR if you confirm which slice is acceptable.

Python840 avatar May 20 '26 01:05 Python840

Hi! I’m interested in helping with this bounty, but the current scope is quite broad.

Would you accept a first focused PR that implements the role/permission foundation only, e.g. owner/admin/member/viewer semantics plus the relevant permission checks and tests, leaving deeper team-management and bulk invitation workflows for follow-up PRs?

If that scope works, I can keep the change small and aligned with the existing Dokploy patterns.

ktimo253-ctrl avatar May 20 '26 13:05 ktimo253-ctrl

/attempt #1413

I am taking a focused invitation-cleanup slice from the broader organization management issue:

  • keep the existing cancel flow for active pending invitations;
  • allow permanent removal only for expired or inactive invitations;
  • enforce that rule server-side in organization.removeInvitation;
  • hide the remove action for active pending invitations in the settings UI;
  • add focused tests for the invitation removal state rules.

Validation so far: focused Vitest coverage, Biome check, and Dokploy TypeScript check.

chriszlr avatar May 20 '26 14:05 chriszlr

/attempt #1413

Working on a focused built-in viewer role slice: read-only assigned runtime access, invite/change-role support, reserved-name handling, and settings-route guards.

Rainash48 avatar May 20 '26 16:05 Rainash48

Multiple PRs welcome — bounty will be split among merged contributors based on scope of contribution.

JavierChaparroMX avatar May 20 '26 18:05 JavierChaparroMX

/attempt #1413

Taking a focused non-overlapping slice for the unchecked “Enable the option to register new users” item: add an opt-in self-hosted registration flag so operators can allow additional users to sign up after the initial owner exists. Scope will stay narrow: server-side signup guard, register-page routing/copy/link visibility, and focused validation. This is separate from the existing viewer-role, ownership-transfer, invitation-cleanup, and organization-description PRs.

swhan0329 avatar May 20 '26 18:05 swhan0329

Multiple PRs welcome — bounty will be split among merged contributors based on scope of contribution.

Also please follow this Before PR https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md and make sure include a video or screenshot

vishalkadam47 avatar May 20 '26 19:05 vishalkadam47

Working on team management slice: enable teams, add DB schema/migration, and add basic org team UI.

/attempt #1413

nijanthan-dev avatar May 20 '26 22:05 nijanthan-dev

Hi, I’d like to help with #1413, but I can see ownership transfer, invitation cleanup, viewer role, registration, organization descriptions, server-access tests, and a basic team-management slice are already being attempted.

Before I start, would a narrow non-overlapping team-support slice still be useful, for example:

  • member move-between-teams API/UI after the team schema lands, or
  • team-based invitation handling once a team model exists, or
  • team-wide permission inheritance tests around the existing member access model?

I’ll wait for a confirmed scope before opening a PR so I don’t duplicate active work.

Hassan2709 avatar May 20 '26 23:05 Hassan2709

/attempt #1413

Taking a narrow permission-update hardening slice that does not overlap with the open ownership, invitation cleanup, viewer-role, registration, org-description, or teams PRs.

Scope:

  • make customRole.update fail with NOT_FOUND when the requested role does not exist in the active organization
  • avoid writing audit metadata for a no-op missing-role update
  • add focused regression coverage for missing-role and successful update paths

Validation so far:

  • focused Vitest coverage passes
  • Biome check on touched files passes
  • Dokploy TypeScript check passes

SZoloth avatar May 21 '26 03:05 SZoloth

/attempt #1413

Taking a narrow, non-overlapping organization-role consistency slice: validate the role used by self-hosted direct credentials provisioning before creating the member. Invitation and change-role flows already reject unknown custom roles, but the credentials path could persist any non-owner string. I will keep this focused on shared role validation plus unit coverage, separate from viewer-role, registration, teams, ownership-transfer, invitation-cleanup, and custom-role update PRs.

SadmanPinon avatar May 21 '26 03:05 SadmanPinon