Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cbox-commit-8] Temporarily read user ACLs until we migrate the exist… #3053

Merged
merged 2 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/user-acl-eos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Temporary read user acl instead of sys acl

We read the user acl in EOS until the migration of all user acls to sys acls are done

https://github.com/cs3org/reva/pull/3053
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