mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Access control: refactor RBAC checks (#48107)
* refactor RBAC checks * fix a test * another test fix * and another
This commit is contained in:
@@ -105,7 +105,7 @@ func (c *PermissionChecker) CheckWritePermissions(ctx context.Context, orgId int
|
||||
if !c.features.IsEnabled(featuremgmt.FlagAnnotationComments) {
|
||||
return false, nil
|
||||
}
|
||||
if c.features.IsEnabled(featuremgmt.FlagAccesscontrol) {
|
||||
if !c.accessControl.IsDisabled() {
|
||||
evaluator := accesscontrol.EvalPermission(accesscontrol.ActionAnnotationsWrite, accesscontrol.ScopeAnnotationsTypeDashboard)
|
||||
if canEdit, err := c.accessControl.Evaluate(ctx, signedInUser, evaluator); err != nil || !canEdit {
|
||||
return canEdit, err
|
||||
|
||||
Reference in New Issue
Block a user