Skip to content

Commit

Permalink
Fix role existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Mar 21, 2024
1 parent 602e3d2 commit e5a0daa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions path_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ func pathRole(b *grafanaBackend) []*framework.Path {
}

func (b *grafanaBackend) pathRoleExistenceCheck(ctx context.Context, req *logical.Request, d *framework.FieldData) (bool, error) {
_, err := b.getRole(ctx, req.Storage, d.Get("name").(string))
entry, err := b.getRole(ctx, req.Storage, d.Get("name").(string))
if err != nil {
return false, err
}

return true, nil
return entry != nil, nil
}

func (b *grafanaBackend) pathRolesList(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
Expand Down

0 comments on commit e5a0daa

Please sign in to comment.