From 07275773fab8baa5ca3c44356798a76faa20caad Mon Sep 17 00:00:00 2001 From: Jeremy Jacobson Date: Thu, 3 Aug 2023 19:56:42 +0000 Subject: [PATCH] backport of commit ac13bf16d6b5f853c26003cf088ff03988d8e235 --- command/acl/acl_helpers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/acl/acl_helpers.go b/command/acl/acl_helpers.go index b07a819b8726..ac1f1c0e99a7 100644 --- a/command/acl/acl_helpers.go +++ b/command/acl/acl_helpers.go @@ -43,6 +43,12 @@ func GetTokenAccessorIDFromPartial(client *api.Client, partialAccessorID string) func GetPolicyIDFromPartial(client *api.Client, partialID string) (string, error) { // try the builtin policies (by name) first + for _, policy := range structs.ACLBuiltinPolicies { + if partialID == policy.Name { + return policy.ID, nil + } + } + if policy, ok := structs.ACLBuiltinPolicies[partialID]; ok { return policy.ID, nil }