diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-12-01 11:35:01 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-27 12:29:25 +0100 |
commit | 1615312bf1044dcbd98c7e4739467314ada618cf (patch) | |
tree | 9788f5cb7fe746078953cafadf78e3b2e845d52b /core | |
parent | 7d0102bf7302a483209e0d1c926260713f0e56c6 (diff) | |
download | nextcloud-server-1615312bf1044dcbd98c7e4739467314ada618cf.tar.gz nextcloud-server-1615312bf1044dcbd98c7e4739467314ada618cf.zip |
add share permissions to settings page
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/shareitemmodel.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index b699513c734..e7824aca33a 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -158,23 +158,24 @@ var shareType = attributes.shareType; attributes = _.extend({}, attributes); - // Default permissions are Edit (CRUD) and Share - // Check if these permissions are possible - var permissions = OC.PERMISSION_READ; + // get default permissions + var defaultPermissions = OC.getCapabilities()['files_sharing']['default_permissions'] || OC.PERMISSION_ALL; + var possiblePermissions = OC.PERMISSION_READ; + if (this.updatePermissionPossible()) { - permissions = permissions | OC.PERMISSION_UPDATE; + possiblePermissions = possiblePermissions | OC.PERMISSION_UPDATE; } if (this.createPermissionPossible()) { - permissions = permissions | OC.PERMISSION_CREATE; + possiblePermissions = possiblePermissions | OC.PERMISSION_CREATE; } if (this.deletePermissionPossible()) { - permissions = permissions | OC.PERMISSION_DELETE; + possiblePermissions = possiblePermissions | OC.PERMISSION_DELETE; } if (this.configModel.get('isResharingAllowed') && (this.sharePermissionPossible())) { - permissions = permissions | OC.PERMISSION_SHARE; + possiblePermissions = possiblePermissions | OC.PERMISSION_SHARE; } - attributes.permissions = permissions; + attributes.permissions = defaultPermissions & possiblePermissions; if (_.isUndefined(attributes.path)) { attributes.path = this.fileInfoModel.getFullPath(); } |