mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 13:09:22 -06:00
RBAC: Do not set permissions on data sources with wildcard UID in OSS (#87220)
do not set permissions on DS with wildcard UID
This commit is contained in:
parent
b5a084611f
commit
28dd1ddd8e
@ -322,8 +322,8 @@ func (e DatasourcePermissionsService) SetBuiltInRolePermission(ctx context.Conte
|
||||
func (e DatasourcePermissionsService) SetPermissions(ctx context.Context, orgID int64, resourceID string, commands ...accesscontrol.SetResourcePermissionCommand) ([]accesscontrol.ResourcePermission, error) {
|
||||
var dbCommands []resourcepermissions.SetResourcePermissionsCommand
|
||||
for _, cmd := range commands {
|
||||
// Only set query permissions for built-in roles
|
||||
if cmd.Permission != "Query" || cmd.BuiltinRole == "" {
|
||||
// Only set query permissions for built-in roles; do not set permissions for data sources with * as UID, as this would grant wildcard permissions
|
||||
if cmd.Permission != "Query" || cmd.BuiltinRole == "" || resourceID == "*" {
|
||||
continue
|
||||
}
|
||||
actions := DatasourceQueryActions
|
||||
|
Loading…
Reference in New Issue
Block a user