fix(files): cleanups

This commit is contained in:
hexxa 2021-08-20 22:39:21 +08:00 committed by Hexxa
parent c864c2bcb5
commit 2b55d5c159
2 changed files with 5 additions and 4 deletions

View file

@ -109,7 +109,8 @@ func (h *FileHandlers) canAccess(userName, role, op, path string) bool {
}
// TODO: improve performance
for i := 1; i <= len(parts); i++ {
_, ok := h.deps.FileInfos().GetSharing(strings.Join(parts[0:i], "/"))
prefix := strings.Join(parts[0:i], "/")
_, ok := h.deps.FileInfos().GetSharing(prefix)
if ok {
return true
}