Kill edit for specific groups code
This commit is contained in:
parent
408fe08d5e
commit
93416e52a4
@ -305,9 +305,7 @@ class DocumentController extends Controller {
|
|||||||
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
|
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
|
||||||
'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'),
|
'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'),
|
||||||
'wopi_url' => $webSocket,
|
'wopi_url' => $webSocket,
|
||||||
'edit_groups' => $this->appConfig->getAppValue('edit_groups'),
|
'doc_format' => $this->appConfig->getAppValue('doc_format')
|
||||||
'doc_format' => $this->appConfig->getAppValue('doc_format'),
|
|
||||||
'usergroups' => $usergroups
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$policy = new ContentSecurityPolicy();
|
$policy = new ContentSecurityPolicy();
|
||||||
|
@ -17,30 +17,6 @@ $.widget('oc.documentGrid', {
|
|||||||
jQuery.when(this._load(fileId))
|
jQuery.when(this._load(fileId))
|
||||||
.then(function(){
|
.then(function(){
|
||||||
that._render();
|
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;
|
documentsMain.renderComplete = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -51,6 +51,4 @@ script('files', 'jquery.fileupload');
|
|||||||
<?php if ($_['enable_previews']): ?>
|
<?php if ($_['enable_previews']): ?>
|
||||||
<input type="hidden" id="previews_enabled" value="<?php p($_['enable_previews']) ?>" />
|
<input type="hidden" id="previews_enabled" value="<?php p($_['enable_previews']) ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
|
<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']) ?>" />
|
|
Loading…
x
Reference in New Issue
Block a user