diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-list.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-list.less index be63bb3a9c..3d16b76167 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-list.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-list.less @@ -10,6 +10,11 @@ a.umb-list-item:focus { text-decoration: none; } +.umb-list-item--disabled { + cursor: not-allowed; + opacity: 0.6; +} + .umb-list-item:hover .umb-list-checkbox, .umb-list-item--selected .umb-list-checkbox { opacity: 1; diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.controller.js index 92d70765b0..52ddda140d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.controller.js @@ -24,9 +24,12 @@ currentUser = user; // Get usergroups userGroupsResource.getUserGroups({ onlyCurrentUserGroups: false }).then(function (userGroups) { + + // only allow editing and selection if user is member of the group or admin vm.userGroups = _.map(userGroups, function (ug) { - return { group: ug, isMember: user.userGroups.indexOf(ug.alias) !== -1} + return { group: ug, hasAccess: user.userGroups.indexOf(ug.alias) !== -1 || user.userGroups.indexOf("admin") !== -1} }); + vm.loading = false; }); }); @@ -42,7 +45,8 @@ function clickUserGroup(userGroup) { - if (currentUser.userGroups.indexOf(userGroup.group.alias) === -1) { + // only allow editing if user is member of the group or admin + if (currentUser.userGroups.indexOf(userGroup.group.alias) === -1 && currentUser.userGroups.indexOf("admin") === -1) { return; } @@ -55,7 +59,8 @@ function selectUserGroup(userGroup, selection, event) { - if (currentUser.userGroups.indexOf(userGroup.group.alias) === -1) { + // only allow selection if user is member of the group or admin + if (currentUser.userGroups.indexOf(userGroup.group.alias) === -1 && currentUser.userGroups.indexOf("admin") === -1) { return; } diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.html b/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.html index 4c54ce88b1..dddd931b1d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.html +++ b/src/Umbraco.Web.UI.Client/src/views/users/views/groups/groups.html @@ -68,8 +68,8 @@