RBAC: Fix delete team permissions on team delete (#83442)
* RBAC: Remove team permissions on delete * Remove unecessary deletes from store function * Nit on mock * Add test to the database * Nit on comment * Add another test to check that other permissions remain
This commit is contained in:
@@ -127,6 +127,12 @@ func (tapi *TeamAPI) deleteTeamByID(c *contextmodel.ReqContext) response.Respons
|
||||
}
|
||||
return response.Error(http.StatusInternalServerError, "Failed to delete Team", err)
|
||||
}
|
||||
|
||||
// Clear associated team assignments, managed role and permissions
|
||||
if err := tapi.ac.DeleteTeamPermissions(c.Req.Context(), orgID, teamID); err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to delete Team permissions", err)
|
||||
}
|
||||
|
||||
return response.Success("Team deleted")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user