Skip to content

Commit

Permalink
fix: #8728, dont add admins to table
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Oct 8, 2020
1 parent b3ed26a commit f259063
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion public/language/en-GB/admin/manage/privileges.json
Expand Up @@ -48,5 +48,6 @@
"alert.confirm-copyToAllGroup": "Are you sure you wish to apply this group's privilege set to <strong>all categories</strong>?",
"alert.confirm-copyToChildren": "Are you sure you wish to apply this privilege set to <strong>all descendant (child) categories</strong>?",
"alert.confirm-copyToChildrenGroup": "Are you sure you wish to apply this group's privilege set to <strong>all descendant (child) categories</strong>?",
"alert.no-undo": "<em>This action cannot be undone.</em>"
"alert.no-undo": "<em>This action cannot be undone.</em>",
"alert.admin-warning": "Administrators implicitly get all privileges"
}
6 changes: 6 additions & 0 deletions public/src/admin/manage/privileges.js
Expand Up @@ -256,6 +256,12 @@ define('admin/manage/privileges', [
inputEl.focus();

autocomplete.group(inputEl, function (ev, ui) {
if (ui.item.group.name === 'administrators') {
return app.alert({
type: 'warning',
message: '[[admin/manage/privileges:alert.admin-warning]]',
});
}
addGroupToCategory(ui.item.group.name, function () {
modal.modal('hide');
});
Expand Down
5 changes: 1 addition & 4 deletions public/src/modules/autocomplete.js
Expand Up @@ -21,8 +21,7 @@ define('autocomplete', function () {
handleOnSelect(input, onselect, event, ui);
},
source: function (request, response) {
params.query = params.query || request.term;
params.paginate = params.paginate || false;
params.query = request.term;

socket.emit('user.search', params, function (err, result) {
if (err) {
Expand Down Expand Up @@ -51,8 +50,6 @@ define('autocomplete', function () {
}

$('.ui-autocomplete a').attr('data-ajaxify', 'false');
delete params.query;
delete params.paginate;
});
},
});
Expand Down

0 comments on commit f259063

Please sign in to comment.