Skip to content

Commit

Permalink
[cbox-commit-8] Temporarily read user ACLs until we migrate the exist…
Browse files Browse the repository at this point in the history
…ing ones on our MGMs
  • Loading branch information
ishank011 authored and labkode committed Jul 11, 2022
1 parent 0cc758b commit 9e38020
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/eosclient/eosbinary/eosbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,23 @@ func (c *Client) mapToFileInfo(ctx context.Context, kv, attrs map[string]string,
return nil, err
}

// Temporary until we migrate the user ACLs to sys ACLs on our MGMs
// Read user ACLs if sys.eval.useracl is set
if userACLEval, ok := attrs["sys."+userACLEvalKey]; ok && userACLEval == "1" {
if userACL, ok := attrs["user.acl"]; ok {
userAcls, err := acl.Parse(userACL, acl.ShortTextForm)
if err != nil {
return nil, err
}
for _, e := range userAcls.Entries {
err = sysACL.SetEntry(e.Type, e.Qualifier, e.Permissions)
if err != nil {
return nil, err
}
}
}
}

// Read lightweight ACLs recognized by the sys.reva.lwshare attr
if lwACLStr, ok := attrs["sys."+lwShareAttrKey]; ok {
lwAcls, err := acl.Parse(lwACLStr, acl.ShortTextForm)
Expand Down

0 comments on commit 9e38020

Please sign in to comment.