mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
Per-directory permissions: add wildcards support
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -489,8 +489,12 @@ func (u *User) GetPermissionsForPath(p string) []string {
|
||||
// so the first match is the one we are interested to
|
||||
for idx := range dirsForPath {
|
||||
if perms, ok := u.Permissions[dirsForPath[idx]]; ok {
|
||||
permissions = perms
|
||||
break
|
||||
return perms
|
||||
}
|
||||
for dir, perms := range u.Permissions {
|
||||
if match, err := path.Match(dir, dirsForPath[idx]); err == nil && match {
|
||||
return perms
|
||||
}
|
||||
}
|
||||
}
|
||||
return permissions
|
||||
|
||||
Reference in New Issue
Block a user