mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 13:26:07 +00:00
105ebfdd00
This change adds ACL hooks to the remaining catalog and mesh resources, excluding any computed ones. Those will for now continue using the default operator:x permissions. It refactors a lot of the common testing functions so that they can be re-used between resources. There are also some types that we don't yet support (e.g. virtual IPs) that this change adds ACL hooks to for future-proofing.
14 lines
450 B
Go
14 lines
450 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package resource
|
|
|
|
import "github.com/hashicorp/consul/acl"
|
|
|
|
// NoOpACLListHook is a common function that can be used if no special list permission is required for a resource.
|
|
func NoOpACLListHook(_ acl.Authorizer, _ *acl.AuthorizerContext) error {
|
|
// No-op List permission as we want to default to filtering resources
|
|
// from the list using the Read enforcement.
|
|
return nil
|
|
}
|