diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js index c51dba4a01..238317144c 100644 --- a/public/src/admin/manage/category.js +++ b/public/src/admin/manage/category.js @@ -203,7 +203,9 @@ define('admin/manage/category', [ } else { app.alertError('[[error:invalid-data]]'); } - }) + }); + + Category.exposeAssumedPrivileges(); }; Category.refreshPrivilegeTable = function() { @@ -216,10 +218,33 @@ define('admin/manage/category', [ privileges: privileges }, function(html) { $('.privilege-table-container').html(html); + Category.exposeAssumedPrivileges(); }); }); }; + Category.exposeAssumedPrivileges = function() { + /* + If registered-users has a privilege enabled, then all users and groups of that privilege + should be assumed to have that privilege as well, even if not set in the db, so reflect + this arrangement in the table + */ + var privs = []; + $('.privilege-table tr[data-group-name="registered-users"] td input[type="checkbox"]').parent().each(function(idx, el) { + if ($(el).find('input').prop('checked')) { + privs.push(el.getAttribute('data-privilege')); + } + }); + for(var x=0,numPrivs=privs.length;x
-
Categories
+
Active Categories
@@ -55,7 +55,7 @@
-
Categories
+
Disabled Categories
diff --git a/src/views/admin/partials/categories/privileges.tpl b/src/views/admin/partials/categories/privileges.tpl index b6b33ac42b..d18329753e 100644 --- a/src/views/admin/partials/categories/privileges.tpl +++ b/src/views/admin/partials/categories/privileges.tpl @@ -42,4 +42,10 @@
+
+ If the registered-users group is granted a specific privilege, all other groups receive an + implicit privilege, even if they are not explicitly defined/checked. This implicit + privilege is shown to you because all users are part of the registered-users user group, + and so, privileges for additional groups need not be explicitly granted. +
\ No newline at end of file