[v9.2.x] DataSourcePermissions: Handle licensing properly for ds permissions (#59711)
DataSourcePermissions: Handle licensing properly for ds permissions (#59694)
* RBAC: add viewer grand if dspermissions enforcement is not enabled
* RBAC: Change permissions based on role prefix
* RBAC: Add option to for permission service to add a license middleware
* RBAC: Remove actions from query struct
(cherry picked from commit 6d1bcd9f40)
This commit is contained in:
@@ -39,15 +39,9 @@ func (s *AccessControlStore) GetUserPermissions(ctx context.Context, query acces
|
||||
INNER JOIN role ON role.id = permission.role_id
|
||||
` + filter
|
||||
|
||||
if len(query.Actions) > 0 {
|
||||
q += " WHERE permission.action IN("
|
||||
if len(query.Actions) > 0 {
|
||||
q += "?" + strings.Repeat(",?", len(query.Actions)-1)
|
||||
}
|
||||
q += ")"
|
||||
for _, a := range query.Actions {
|
||||
params = append(params, a)
|
||||
}
|
||||
if query.RolePrefix != "" {
|
||||
q += " WHERE role.name LIKE ?"
|
||||
params = append(params, query.RolePrefix+"%")
|
||||
}
|
||||
|
||||
if err := sess.SQL(q, params...).Find(&result); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user