feat(auth): Expose ACL from VerifyResults

This commit is contained in:
Timothy Messier committed 2022-09-07 17:49:01 +00:00
1 parent 05b3d2917b
commit e4bb847ad1
1 file changed
+9
+9
View File
@@ -641,6 +641,15 @@ func (r *VerifyResults) FetchOutputFields(res perms.Resource, act action.Type) p
return r.v.acl.Allowed(res, act, r.UserId).OutputFields
}
// ACL returns the perms.ACL of the verifier.
func (r *VerifyResults) ACL() perms.ACL {
if r.v == nil {
return perms.ACL{}
}
return r.v.acl
}
// GetTokenFromRequest pulls the token from either the Authorization header or
// split cookies and parses it. If it cannot be parsed successfully, the issue
// is logged and we return blank, so logic will continue as the anonymous user.