feat(files): disallow normal users to access home dir
This commit is contained in:
parent
8eac11afda
commit
7752733fb9
1 changed files with 1 additions and 1 deletions
|
@ -96,7 +96,7 @@ func (h *FileHandlers) canAccess(userID, role, op, path string) bool {
|
|||
|
||||
// the file path must start with userID: <userID>/...
|
||||
parts := strings.Split(path, "/")
|
||||
if len(parts) < 1 {
|
||||
if len(parts) < 2 { // the path must be longer than <userName>/files
|
||||
return false
|
||||
} else if parts[0] == userID {
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue