Skip to content

Commit

Permalink
eos: do not read user ACLs any longer (#4892)
Browse files Browse the repository at this point in the history
* eos: do not read user ACLs any longer

* changelog
  • Loading branch information
glpatcern authored Oct 29, 2024
1 parent cf485e7 commit cf70816
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/eos-useracl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: do not read eos user ACLs any longer

This PR drops the compatibility code to read eos user ACLs
in the eos binary client, and aligns it to the GRPC client.

https://github.com/cs3org/reva/pull/4892
22 changes: 2 additions & 20 deletions pkg/eosclient/eosbinary/eosbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ import (
)

const (
versionPrefix = ".sys.v#."
userACLEvalKey = "eval.useracl"
favoritesKey = "http://owncloud.org/ns/favorite"
versionPrefix = ".sys.v#."
favoritesKey = "http://owncloud.org/ns/favorite"
)

func serializeAttribute(a *eosclient.Attribute) string {
Expand Down Expand Up @@ -1226,23 +1225,6 @@ 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 the favorite attr
if parseFavoriteKey {
parseAndSetFavoriteAttr(ctx, attrs)
Expand Down

0 comments on commit cf70816

Please sign in to comment.