summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2016-04-22 14:50:42 +0200
committerBjörn Schießle <schiessle@owncloud.com>2016-04-22 14:50:42 +0200
commit606b756a94643eaae87e18b39f6c75e6d18fec7e (patch)
tree6128dd0ed676164bbfb8a4aa10a56cc511728edd /core/js
parentcc4efc4c03f4d4f7ec9e6cf9beac570254bef3c1 (diff)
parent2a6a336e873db394e9912de20478645f3e4b8fc4 (diff)
downloadnextcloud-server-606b756a94643eaae87e18b39f6c75e6d18fec7e.tar.gz
nextcloud-server-606b756a94643eaae87e18b39f6c75e6d18fec7e.zip
Merge pull request #23918 from owncloud/cruds-for-federated-shares
bring back CRUDS permissions for federated shares
Diffstat (limited to 'core/js')
-rw-r--r--core/js/sharedialogshareelistview.js18
-rw-r--r--core/js/shareitemmodel.js32
2 files changed, 16 insertions, 34 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index fd0b6d9d1bd..83fde154615 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -22,28 +22,25 @@
'<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
'{{/if}}' +
'<span class="has-tooltip username" title="{{shareWith}}">{{shareWithDisplayName}}</span>' +
- '{{#if mailNotificationEnabled}} {{#unless isRemoteShare}}' +
+ '{{#if mailNotificationEnabled}} {{#unless isRemoteShare}}' +
'<span class="shareOption">' +
'<input id="mail-{{cid}}-{{shareWith}}" type="checkbox" name="mailNotification" class="mailNotification checkbox" {{#if wasMailSent}}checked="checked"{{/if}} />' +
'<label for="mail-{{cid}}-{{shareWith}}">{{notifyByMailLabel}}</label>' +
'</span>' +
'{{/unless}} {{/if}}' +
- '{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isRemoteShare}}' +
+ '{{#if isResharingAllowed}} {{#if sharePermissionPossible}}' +
'<span class="shareOption">' +
'<input id="canShare-{{cid}}-{{shareWith}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />' +
'<label for="canShare-{{cid}}-{{shareWith}}">{{canShareLabel}}</label>' +
'</span>' +
- '{{/unless}} {{/if}} {{/if}}' +
+ '{{/if}} {{/if}}' +
'{{#if editPermissionPossible}}' +
'<span class="shareOption">' +
'<input id="canEdit-{{cid}}-{{shareWith}}" type="checkbox" name="edit" class="permissions checkbox" {{#if hasEditPermission}}checked="checked"{{/if}} />' +
'<label for="canEdit-{{cid}}-{{shareWith}}">{{canEditLabel}}</label>' +
- '{{#unless isRemoteShare}}' +
'<a href="#" class="showCruds"><img class="svg" alt="{{crudsLabel}}" src="{{triangleSImage}}"/></a>' +
- '{{/unless}}' +
'</span>' +
'{{/if}}' +
- '{{#unless isRemoteShare}}' +
'<div class="cruds hidden">' +
'{{#if createPermissionPossible}}' +
'<span class="shareOption">' +
@@ -57,14 +54,13 @@
'<label for="canUpdate-{{cid}}-{{shareWith}}">{{updatePermissionLabel}}</label>' +
'</span>' +
'{{/if}}' +
- '{{#if deletePermissionPossible}} {{#unless isRemoteShare}}' +
+ '{{#if deletePermissionPossible}}' +
'<span class="shareOption">' +
'<input id="canDelete-{{cid}}-{{shareWith}}" type="checkbox" name="delete" class="permissions checkbox" {{#if hasDeletePermission}}checked="checked"{{/if}} data-permissions="{{deletePermission}}"/>' +
'<label for="canDelete-{{cid}}-{{shareWith}}">{{deletePermissionLabel}}</label>' +
'</span>' +
- '{{/unless}} {{/if}}' +
+ '{{/if}}' +
'</div>' +
- '{{/unless}}' +
'</li>' +
'{{/each}}' +
'</ul>'
@@ -125,10 +121,6 @@
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'group') + ')';
} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'remote') + ')';
- hasPermissionOverride = {
- createPermissionPossible: true,
- updatePermissionPossible: true
- };
}
return _.extend(hasPermissionOverride, {
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 292230d26d5..3ced66a1a78 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -154,21 +154,17 @@
// Default permissions are Edit (CRUD) and Share
// Check if these permissions are possible
var permissions = OC.PERMISSION_READ;
- 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;
- }
+ 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;
@@ -411,12 +407,6 @@
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;
},