summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-21 19:06:54 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-21 19:06:54 +0200
commit693484008360b219848d4fbcdce9b7f26987850b (patch)
treebe128b41a2717b4fe9814c08f40d63d7913dca92 /settings
parentbca7586574dc3daf6a890688fdf7634f6fa58bab (diff)
parentb40c0bad9685873bbcd61f310717c0da0c9faf75 (diff)
downloadnextcloud-server-693484008360b219848d4fbcdce9b7f26987850b.tar.gz
nextcloud-server-693484008360b219848d4fbcdce9b7f26987850b.zip
Merge pull request #24307 from owncloud/systemtags-perminterface
Add interface methods for permission check for system tags
Diffstat (limited to 'settings')
-rw-r--r--settings/js/settings.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/settings/js/settings.js b/settings/js/settings.js
index fcbe328b76f..5a2ba4bcec7 100644
--- a/settings/js/settings.js
+++ b/settings/js/settings.js
@@ -16,10 +16,13 @@ OC.Settings = _.extend(OC.Settings, {
* for groups)
*
* @param $elements jQuery element (hidden input) to setup select2 on
- * @param [extraOptions] extra options hash to pass to select2
+ * @param {Array} [extraOptions] extra options hash to pass to select2
+ * @param {Array} [options] extra options
+ * @param {Array} [options.excludeAdmins=false] flag whether to exclude admin groups
*/
- setupGroupsSelect: function($elements, extraOptions) {
+ setupGroupsSelect: function($elements, extraOptions, options) {
var self = this;
+ options = options || {};
if ($elements.length > 0) {
// note: settings are saved through a "change" event registered
// on all input fields
@@ -48,9 +51,11 @@ OC.Settings = _.extend(OC.Settings, {
var results = [];
// add groups
- $.each(data.data.adminGroups, function(i, group) {
- results.push({id:group.id, displayname:group.name});
- });
+ if (!options.excludeAdmins) {
+ $.each(data.data.adminGroups, function(i, group) {
+ results.push({id:group.id, displayname:group.name});
+ });
+ }
$.each(data.data.groups, function(i, group) {
results.push({id:group.id, displayname:group.name});
});