Skip to content

Conversation

@aslilac
Copy link
Member

@aslilac aslilac commented Feb 26, 2025

currently, we use ActionDelete to determine whether you can unassign a role, which is terrible, because we also use that to determine if you can delete the role itself.

there is more cleanup to do here, like renaming the roles resources to not start with assign_, but this change means that we can remove organization_role.delete from org user admins, which fixes a UI bug. this was a lot of work to fix a single button, but it needed to be done anyway. 😅

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 1 nit 👍

// TODO: Handle org scoped lookups
func (q *querier) CustomRoles(ctx context.Context, arg database.CustomRolesParams) ([]database.CustomRole, error) {
if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceAssignRole); err != nil {
roleObject := rbac.ResourceAssignOrgRole
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
roleObject := rbac.ResourceAssignOrgRole
roleObject := rbac.ResourceAssignRole

@aslilac aslilac merged commit 91a4a98 into main Feb 27, 2025
35 checks passed
@aslilac aslilac deleted the lilac/action-unassign branch February 27, 2025 17:39
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2025
@stirby
Copy link
Collaborator

stirby commented Mar 4, 2025

/cherry-pick release/2.20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants