1
0
mirror of https://github.com/drakkan/sftpgo.git synced 2025-11-23 22:04:50 +02:00

add a new permission for overwriting existing files

The upload permission is required to allow file overwrite
This commit is contained in:
Nicola Murino
2019-09-17 08:53:45 +02:00
parent 580fae7a8f
commit df96ea7e9f
9 changed files with 110 additions and 13 deletions

View File

@@ -62,7 +62,7 @@ class SFTPGoApiRequests:
download_bandwidth=0):
user = {"id":user_id, "username":username, "uid":uid, "gid":gid,
"max_sessions":max_sessions, "quota_size":quota_size, "quota_files":quota_files,
"upload_bandwidth":upload_bandwidth,"download_bandwidth":download_bandwidth}
"upload_bandwidth":upload_bandwidth, "download_bandwidth":download_bandwidth}
if password:
user.update({"password":password})
if public_keys:
@@ -136,7 +136,7 @@ def addCommonUserArguments(parser):
help='Maximum size allowed as bytes. 0 means unlimited. Default: %(default)s')
parser.add_argument('-F', '--quota-files', type=int, default=0, help="default: %(default)s")
parser.add_argument('-G', '--permissions', type=str, nargs='+', default=[],
choices=['*', 'list', 'download', 'upload', 'delete', 'rename', 'create_dirs',
choices=['*', 'list', 'download', 'upload', 'overwrite', 'delete', 'rename', 'create_dirs',
'create_symlinks'], help='Default: %(default)s')
parser.add_argument('-U', '--upload-bandwidth', type=int, default=0,
help='Maximum upload bandwidth as KB/s, 0 means unlimited. Default: %(default)s')