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

Minor optimization in parsing EOS ACLs #1855

Merged
merged 2 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions changelog/unreleased/eos-acl-optimization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Minor optimization in parsing EOS ACLs

https://github.com/cs3org/reva/pull/1855
12 changes: 8 additions & 4 deletions pkg/storage/utils/eosfs/eosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1520,12 +1520,16 @@ func (fs *eosfs) permissionSet(ctx context.Context, eosFileInfo *eosclient.FileI
var perm provider.ResourcePermissions
for _, e := range eosFileInfo.SysACL.Entries {
var userInGroup bool
for _, g := range u.Groups {
if e.Qualifier == g {
userInGroup = true
if e.Type == acl.TypeGroup {
for _, g := range u.Groups {
if e.Qualifier == g {
userInGroup = true
break
}
}
}
if e.Qualifier == uid || userInGroup {

if (e.Type == acl.TypeUser && e.Qualifier == uid) || userInGroup {
mergePermissions(&perm, grants.GetGrantPermissionSet(e.Permissions, eosFileInfo.IsDir))
}
}
Expand Down