enable recovery user to list targets and sessions (#2576)

* enable recovery user to list targets and sessions
This commit is contained in:
Irena Rindos authored and GitHub committed 2022-10-28 11:17:33 -04:00
1 parent 0c18dc0729
commit 946dab487e
10 files changed
+161 -52

No files matched your search

+3 -3
View File
@@ -849,13 +849,13 @@ func (r *VerifyResults) ScopesAuthorizedForList(ctx context.Context, rootScopeId
// We only expect the action set to be nothing, or list. In case
// this is not the case, we bail out.
switch len(aSet) {
case 0:
switch {
case len(aSet) == 0:
// Defer until we've read all scopes. We do this because if the
// ordering coming back isn't in parent-first ordering our map
// lookup might fail.
deferredScopes = append(deferredScopes, scp)
case 1:
case len(aSet) == 1 || r.UserId == perms.RecoveryUserId:
if aSet[0] != action.List {
return nil, errors.New(ctx, errors.Internal, op, "unexpected action in set")
}