Merge pull request #10700 from nextcloud/fix/10516/sharepermissions
Fix share dialog sidebar in share views
This commit is contained in:
commit
6d749bf021
|
@ -166,24 +166,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
updateRow: function($tr, fileInfo, options) {
|
updateRow: function($tr, fileInfo, options) {
|
||||||
if(!fileInfo instanceof OCA.Sharing.SharedFileInfo) {
|
// no-op, suppress re-rendering
|
||||||
// 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);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
reload: function() {
|
reload: function() {
|
||||||
|
@ -328,11 +311,11 @@
|
||||||
* Converts the OCS API share response data to a file info
|
* Converts the OCS API share response data to a file info
|
||||||
* list
|
* list
|
||||||
* @param {Array} data OCS API share array
|
* @param {Array} data OCS API share array
|
||||||
|
* @param {bool} sharedWithUser
|
||||||
* @return {Array.<OCA.Sharing.SharedFileInfo>} array of shared file info
|
* @return {Array.<OCA.Sharing.SharedFileInfo>} array of shared file info
|
||||||
*/
|
*/
|
||||||
_makeFilesFromShares: function(data, sharedWithUser) {
|
_makeFilesFromShares: function(data, sharedWithUser) {
|
||||||
/* jshint camelcase: false */
|
/* jshint camelcase: false */
|
||||||
var self = this;
|
|
||||||
var files = data;
|
var files = data;
|
||||||
|
|
||||||
if (this._linksOnly) {
|
if (this._linksOnly) {
|
||||||
|
@ -447,8 +430,8 @@
|
||||||
// array of sorted names
|
// array of sorted names
|
||||||
data.mountType = 'shared';
|
data.mountType = 'shared';
|
||||||
delete data.recipientsCount;
|
delete data.recipientsCount;
|
||||||
if (self._sharedWithUser) {
|
if (sharedWithUser) {
|
||||||
// only for outgoing shres
|
// only for outgoing shares
|
||||||
delete data.shareTypes;
|
delete data.shareTypes;
|
||||||
} else {
|
} else {
|
||||||
data.shareTypes = _.keys(data.shareTypes);
|
data.shareTypes = _.keys(data.shareTypes);
|
||||||
|
|
|
@ -777,7 +777,7 @@
|
||||||
return {};
|
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) {
|
if(!_.isUndefined(data.reshare) && !_.isUndefined(data.reshare.permissions) && data.reshare.uid_owner !== OC.currentUser) {
|
||||||
permissions = permissions & data.reshare.permissions;
|
permissions = permissions & data.reshare.permissions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -345,7 +345,7 @@ describe('OC.Share.ShareItemModel', function() {
|
||||||
}]));
|
}]));
|
||||||
fetchSharesDeferred.resolve(makeOcsResponse([]));
|
fetchSharesDeferred.resolve(makeOcsResponse([]));
|
||||||
|
|
||||||
model.set('possiblePermissions', OC.PERMISSION_READ);
|
model.fileInfoModel.set('permissions', OC.PERMISSION_READ);
|
||||||
model.fetch();
|
model.fetch();
|
||||||
|
|
||||||
// no resharing allowed
|
// no resharing allowed
|
||||||
|
|
Loading…
Reference in New Issue