diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-08-20 17:14:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 17:14:12 +0200 |
commit | 6d749bf0215c4f155d402620544e669c0cce37ec (patch) | |
tree | 157c40964bbb0ec7cbd1ec5f26f8e6adee5f5553 | |
parent | a6fb5c5dba079e4803b2743abf2c09b048fc3507 (diff) | |
parent | be873c234b077f48472f1d46f1998343e815fe86 (diff) | |
download | nextcloud-server-6d749bf0215c4f155d402620544e669c0cce37ec.tar.gz nextcloud-server-6d749bf0215c4f155d402620544e669c0cce37ec.zip |
Merge pull request #10700 from nextcloud/fix/10516/sharepermissions
Fix share dialog sidebar in share views
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 25 | ||||
-rw-r--r-- | core/js/shareitemmodel.js | 2 | ||||
-rw-r--r-- | core/js/tests/specs/shareitemmodelSpec.js | 2 |
3 files changed, 6 insertions, 23 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 71192497143..84e4e62f8a1 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -166,24 +166,7 @@ }, updateRow: function($tr, fileInfo, options) { - if(!fileInfo instanceof OCA.Sharing.SharedFileInfo) { - // recycle SharedFileInfo values if something tries to overwrite it - var oldModel = this.getModelForFile($tr); - - if(_.isUndefined(fileInfo.recipientData) && oldModel.recipientData) { - fileInfo.recipientData = oldModel.recipientData; - } - if(_.isUndefined(fileInfo.recipients) && oldModel.recipientData) { - fileInfo.recipientData = oldModel.recipientData; - } - if(_.isUndefined(fileInfo.shares) && oldModel.shares) { - fileInfo.shares = oldModel.shares; - } - if(_.isUndefined(fileInfo.shareOwner) && oldModel.shareOwner) { - fileInfo.shareOwner = oldModel.shareOwner; - } - } - OCA.Files.FileList.prototype._createRow.updateRow(this, arguments); + // no-op, suppress re-rendering }, reload: function() { @@ -328,11 +311,11 @@ * Converts the OCS API share response data to a file info * list * @param {Array} data OCS API share array + * @param {bool} sharedWithUser * @return {Array.<OCA.Sharing.SharedFileInfo>} array of shared file info */ _makeFilesFromShares: function(data, sharedWithUser) { /* jshint camelcase: false */ - var self = this; var files = data; if (this._linksOnly) { @@ -447,8 +430,8 @@ // array of sorted names data.mountType = 'shared'; delete data.recipientsCount; - if (self._sharedWithUser) { - // only for outgoing shres + if (sharedWithUser) { + // only for outgoing shares delete data.shareTypes; } else { data.shareTypes = _.keys(data.shareTypes); diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 241b9c19c0d..c28d85efbf0 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -777,7 +777,7 @@ return {}; } - var permissions = this.get('possiblePermissions'); + var permissions = this.fileInfoModel.get('permissions'); if(!_.isUndefined(data.reshare) && !_.isUndefined(data.reshare.permissions) && data.reshare.uid_owner !== OC.currentUser) { permissions = permissions & data.reshare.permissions; } diff --git a/core/js/tests/specs/shareitemmodelSpec.js b/core/js/tests/specs/shareitemmodelSpec.js index 0a345786b73..2e89b2e3cda 100644 --- a/core/js/tests/specs/shareitemmodelSpec.js +++ b/core/js/tests/specs/shareitemmodelSpec.js @@ -345,7 +345,7 @@ describe('OC.Share.ShareItemModel', function() { }])); fetchSharesDeferred.resolve(makeOcsResponse([])); - model.set('possiblePermissions', OC.PERMISSION_READ); + model.fileInfoModel.set('permissions', OC.PERMISSION_READ); model.fetch(); // no resharing allowed |