Skip to content

Commit

Permalink
change isReadableByUser logic regarding zones
Browse files Browse the repository at this point in the history
change from checking the zone of the acl matches the zone of the file to
it matching the zone passed to the function
  • Loading branch information
dkj committed Nov 3, 2024
1 parent e2812c7 commit 57d07f7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions server/irods.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,10 @@ func NewIRODSAccount(logger zerolog.Logger,
func isReadableByUser(logger zerolog.Logger, filesystem *ifs.FileSystem,
userZone string, userName string, rodsPath string) (_ bool, err error) {
var acl []*types.IRODSAccess
var pathZone string

if acl, err = filesystem.ListACLs(rodsPath); err != nil {
return false, err
}
if pathZone, err = util.GetIRODSZone(rodsPath); err != nil {
return false, err
}

for _, ac := range acl {
// ACL user zone may be empty if it refers to the local zone
Expand All @@ -223,7 +219,7 @@ func isReadableByUser(logger zerolog.Logger, filesystem *ifs.FileSystem,
effectiveUserZone = userZone
}

if effectiveUserZone == pathZone &&
if effectiveUserZone == userZone &&
ac.UserName == userName &&
ac.AccessLevel == types.IRODSAccessLevelReadObject {
logger.Trace().
Expand Down

0 comments on commit 57d07f7

Please sign in to comment.