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

FIX: vestigial irods/util import
  • Loading branch information
dkj committed Nov 5, 2024
1 parent 323634e commit 76d189c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions server/irods.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
ifs "github.com/cyverse/go-irodsclient/fs"
"github.com/cyverse/go-irodsclient/icommands"
"github.com/cyverse/go-irodsclient/irods/types"
"github.com/cyverse/go-irodsclient/irods/util"
"github.com/rs/zerolog"
)

Expand Down Expand Up @@ -196,14 +195,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 @@ -214,7 +209,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 76d189c

Please sign in to comment.