Kill edit for specific groups code

pull/1/head
Pranav Kant 8 years ago
parent 408fe08d5e
commit 93416e52a4

@ -305,9 +305,7 @@ class DocumentController extends Controller {
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'),
'wopi_url' => $webSocket,
'edit_groups' => $this->appConfig->getAppValue('edit_groups'),
'doc_format' => $this->appConfig->getAppValue('doc_format'),
'usergroups' => $usergroups
'doc_format' => $this->appConfig->getAppValue('doc_format')
]);
$policy = new ContentSecurityPolicy();

@ -17,30 +17,6 @@ $.widget('oc.documentGrid', {
jQuery.when(this._load(fileId))
.then(function(){
that._render();
// TODO: Handle all of this logic by sending UserCanWrite: false to loolwsd
if (!documentsMain.isGuest) {
var editGroups = $('#edit_groups').val()
.split('|')
.filter(function(e) {
return e.length !== 0;
});
var usergroups = $('#usergroups').val()
.split('|')
.filter(function(e) {
return e.length !== 0;
});
documentsMain.canEdit = (editGroups.length === 0);
if (!documentsMain.canEdit && usergroups.length >= 1) {
for (var idx in usergroups) {
if (editGroups.indexOf(usergroups[idx]) !== -1) {
documentsMain.canEdit = true;
break;
}
}
}
}
documentsMain.renderComplete = true;
});
},

@ -51,6 +51,4 @@ script('files', 'jquery.fileupload');
<?php if ($_['enable_previews']): ?>
<input type="hidden" id="previews_enabled" value="<?php p($_['enable_previews']) ?>" />
<?php endif; ?>
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
<input type="hidden" name="edit_groups" id="edit_groups" value="<?php p($_['edit_groups']) ?>" />
<input type="hidden" name="usergroups" id="usergroups" value="<?php p($_['usergroups']) ?>" />
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
Loading…
Cancel
Save