allow admins to edit all groups
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
</div>
|
||||
|
||||
<div class="umb-list" ng-if="!vm.loading" ng-switch="">
|
||||
<div ng-repeat="group in vm.userGroups | filter:vm.filter" ng-switch="group.isMember">
|
||||
<div class="umb-list-item" ng-switch-when="false">
|
||||
<div ng-repeat="group in vm.userGroups | filter:vm.filter" ng-switch="group.hasAccess">
|
||||
<div class="umb-list-item umb-list-item--disabled" ng-switch-when="false">
|
||||
<div style="margin-right: 25px;">
|
||||
<div class="umb-list-checkbox"></div>
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
content-start-node="group.group.contentStartNode"
|
||||
media-start-node="group.group.mediaStartNode">
|
||||
</umb-user-group-preview>
|
||||
</a>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user