diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-06-13 17:30:20 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-06-13 17:30:20 +0300 |
commit | 0cbfdf7d8b1a186daa0435b40abc29b3546f46c6 (patch) | |
tree | 694639900d35878eec0a4477c95991d445c2e6bf /core | |
parent | 12df3eb71d63ca9dac61f8b353aa9d590c5f8f63 (diff) |
revert suspicious change - please check this @schiessle & @LukasReschke
Diffstat (limited to 'core')
-rw-r--r-- | core/js/shareitemmodel.js | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index a3accb4f5dc..30def474401 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -154,17 +154,21 @@ // Default permissions are Edit (CRUD) and Share // Check if these permissions are possible var permissions = OC.PERMISSION_READ; - if (this.updatePermissionPossible()) { - permissions = permissions | OC.PERMISSION_UPDATE; - } - if (this.createPermissionPossible()) { - permissions = permissions | OC.PERMISSION_CREATE; - } - if (this.deletePermissionPossible()) { - permissions = permissions | OC.PERMISSION_DELETE; - } - if (this.configModel.get('isResharingAllowed') && (this.sharePermissionPossible())) { - permissions = permissions | OC.PERMISSION_SHARE; + if (shareType === OC.Share.SHARE_TYPE_REMOTE) { + permissions = OC.PERMISSION_CREATE | OC.PERMISSION_UPDATE | OC.PERMISSION_READ; + } else { + if (this.updatePermissionPossible()) { + permissions = permissions | OC.PERMISSION_UPDATE; + } + if (this.createPermissionPossible()) { + permissions = permissions | OC.PERMISSION_CREATE; + } + if (this.deletePermissionPossible()) { + permissions = permissions | OC.PERMISSION_DELETE; + } + if (this.configModel.get('isResharingAllowed') && (this.sharePermissionPossible())) { + permissions = permissions | OC.PERMISSION_SHARE; + } } attributes.permissions = permissions; @@ -414,6 +418,12 @@ if(!_.isObject(share)) { throw "Unknown Share"; } + if( share.share_type === OC.Share.SHARE_TYPE_REMOTE + && ( permission === OC.PERMISSION_SHARE + || permission === OC.PERMISSION_DELETE)) + { + return false; + } return (share.permissions & permission) === permission; }, @@ -801,4 +811,4 @@ }); OC.Share.ShareItemModel = ShareItemModel; -})();
\ No newline at end of file +})(); |