Access control: Delete user permissions when a user is deleted (#46021)
* Remove access control related to user on deletion
This commit is contained in:
@@ -2,6 +2,7 @@ package accesscontrol
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
@@ -192,3 +193,15 @@ func GetResourcesMetadata(ctx context.Context, permissions map[string][]string,
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func ManagedUserRoleName(userID int64) string {
|
||||
return fmt.Sprintf("managed:users:%d:permissions", userID)
|
||||
}
|
||||
|
||||
func ManagedTeamRoleName(teamID int64) string {
|
||||
return fmt.Sprintf("managed:teams:%d:permissions", teamID)
|
||||
}
|
||||
|
||||
func ManagedBuiltInRoleName(builtInRole string) string {
|
||||
return fmt.Sprintf("managed:builtins:%s:permissions", strings.ToLower(builtInRole))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user