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

RBAC: Fix delete team permissions on team delete #83442

Merged
merged 7 commits into from
Feb 27, 2024
Merged

Conversation

gamab
Copy link
Contributor

@gamab gamab commented Feb 26, 2024

What is this feature?

On team deletion, we need to delete the associated RBAC assignments, role and permissions.

Why do we need this feature?

[Add a description of the problem the feature is trying to solve.]

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:

Fixes #74900

Special notes for your reviewer:

@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.0.x milestone Feb 26, 2024
@gamab gamab changed the title RBAC: Delete team permission on team delete RBAC: Fix delete team permissions on team delete Feb 26, 2024
@gamab gamab added add to changelog no-backport Skip backport of PR labels Feb 26, 2024
@gamab gamab self-assigned this Feb 26, 2024
@gamab gamab marked this pull request as ready for review February 26, 2024 20:54
@gamab gamab requested a review from a team as a code owner February 26, 2024 20:54
@@ -241,3 +241,58 @@ func (s *AccessControlStore) DeleteUserPermissions(ctx context.Context, orgID, u
})
return err
}

func (s *AccessControlStore) DeleteTeamPermissions(ctx context.Context, orgID, teamID int64) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that the orgID is not really mandatory, but it provides some consistency with DeleteUserPermissions

@gamab gamab merged commit 8d9921a into main Feb 27, 2024
12 checks passed
@gamab gamab deleted the gamab/rbac/team-deletion branch February 27, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teams: Cannot add team to dashboard/folder permission after deleting and recreating it with the same ID
3 participants