pgadmin-org / pgadmin-org/pgadmin4

Group Role dialog doesn't allow users "with admin" option to add other users

Open
#9,450 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Python
Stars
3.8k
Forks
891
Avg merge
4d 7h
Merged PRs (30d)
8

Description

Describe the bug

The "Group Role" dialog doesn't allow users who have been granted "with admin" to add other members to the role as the + icon is not displayed.

To Reproduce

Steps to reproduce the behavior:

  1. Expand Servers > Server > Login/Group Roles
  2. Right click on a role and choose "Properties"
  3. Switch to the "Membership" tab
  4. No plus icon is not shown to allow a user "with admin option" to add new members.

Expected behavior

Users granted "with admin" should see the + icon to allow adding other members to the role.

Error message

The user can't add role members because the plus icon isn't shown. However if the user "with admin" option attempts to grant "with admin" to another user then they incorrectly get the error "The current user does not have permission to update the role."

Screenshots

N/A

Desktop (please complete the following information):

  • OS: Fedora Linux 43
  • pgAdmin version: 9.10
  • Mode: Server
  • Browser (if running in server mode): Chromium
  • Package type: Python

Additional context

The role UI only allows editing if the user is a super user or has the "create role" permission, however if the user is a member of the role "with admin" option, they don't need either of these to be allowed to add new members to the role.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with web/pgadmin/browser/server_groups/servers/roles/static/js/role.ui.js at the linked permission check, then reproduce the Membership-tab steps with a role member granted "with admin." Confirm the + control is available to that user and that adding members succeeds without the reported permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgresql, python
Domain
authorization, databases, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.