Skip to content

Commit

Permalink
Fix storage path for roles
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Mar 21, 2024
1 parent 77ffcdc commit 602e3d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions path_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (b *grafanaBackend) pathRolesWrite(ctx context.Context, req *logical.Reques
}

func (b *grafanaBackend) pathRolesDelete(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
err := req.Storage.Delete(ctx, "role/"+d.Get("name").(string))
err := req.Storage.Delete(ctx, "roles/"+d.Get("name").(string))
if err != nil {
return nil, fmt.Errorf("error deleting grafana role: %w", err)
}
Expand All @@ -305,7 +305,7 @@ func (b *grafanaBackend) pathRolesDelete(ctx context.Context, req *logical.Reque
}

func setRole(ctx context.Context, s logical.Storage, name string, roleEntry *grafanaRoleEntry) error {
entry, err := logical.StorageEntryJSON("role/"+name, roleEntry)
entry, err := logical.StorageEntryJSON("roles/"+name, roleEntry)
if err != nil {
return err
}
Expand All @@ -326,7 +326,7 @@ func (b *grafanaBackend) getRole(ctx context.Context, s logical.Storage, name st
return nil, fmt.Errorf("missing role name")
}

entry, err := s.Get(ctx, "role/"+name)
entry, err := s.Get(ctx, "roles/"+name)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 602e3d2

Please sign in to comment.