Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roles.set_members #3733

Closed
Tracked by #3639
pavish opened this issue Aug 6, 2024 · 1 comment · Fixed by #3866
Closed
Tracked by #3639

roles.set_members #3733

pavish opened this issue Aug 6, 2024 · 1 comment · Fixed by #3866

Comments

@pavish
Copy link
Member

pavish commented Aug 6, 2024

  • API gets the new members of a role, compares with existing member list, grants role to new members, and revokes role from removed members.

Request parameters:

database_id: Database['id'];
role_oid: Role['oid'];
members: Role['oid'][];

Response:
RoleInfo of role_oid (Refer mathesar/rpc/roles.py)

API behaviour:

  • Existing members of role base are a,b,c
  • Request:
    database_id: 1,
    role_oid: 1, //oid of `base`
    members: [a, x, y] // oids of `a, x, y` (should be integers but name is specified here for ease of understanding)
    
  • API should revoke base from b and c.
     revoke base from b;
     revoke base from c;
    
  • API should grant base to x and y.
     grant base to x;
     grant base to y;
    
  • a should NOT be modified.
  • All these should happen in a single transaction.
  • If an empty array is sent for members, all member roles should be removed.
@pavish pavish changed the title roles.add_member: (database_id, role_oid, member: role_oid) => RoleInfo roles.add_member Aug 6, 2024
@pavish pavish added the ready Ready for implementation label Aug 6, 2024
@pavish pavish changed the title roles.add_member roles.set_members Aug 20, 2024
@pavish pavish removed the ready Ready for implementation label Aug 20, 2024
@pavish
Copy link
Member Author

pavish commented Aug 22, 2024

We would require configuring the WITH ADMIN option for this function for each member role, but that can be deferred to after BETA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants