Skip to content

Admin users blocked from changing git branch on compose deployments #4469

@Alt-iOS

Description

@Alt-iOS

To Reproduce

  1. Create an organization with user A (owner) and user B (admin)
  2. As user A, create a compose deployment with a GitHub provider (sourceType: github)
  3. Log in as user B (admin) and navigate to that same compose
  4. Go to the General tab → Provider section
  5. See "Unauthorized Git Provider" card instead of the branch/configuration form

Current vs. Expected behavior

Current: Admin users see an "Unauthorized Git Provider" card that only allows disconnecting the repository. They cannot change the branch, provider, or any git configuration.

Expected: Admin users should have full access to the provider form, including the ability to change the branch, just like the owner. The same access logic used by getAccessibleGitProviderIds() (which already grants admins access to all org git providers) should apply here.

Provide environment information

Operating System: macOS (colima)
   Dokploy version: v0.29.4 (canary branch)

Which area(s) are affected? (Select all that apply)

Application, Docker Compose, Docker

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

In both compose.ts and application.ts, the one query checks gitProvider.userId !== ctx.session.userId to set hasGitProviderAccess. This doesn't account for admin/owner roles or the sharedWithOrganization flag on git providers. The fix is to use the existing getAccessibleGitProviderIds() function instead, which already handles all these cases correctly.

Will you send a PR to fix it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions