Clear
</button>
</div>
+
+ <div class="row font-italic">
+ <span class="label-with-material-icon" i18n>
+ Permissions marked with a
+ <span class="pl-1 pr-1 font-weight-bold text-danger
+ material-icons mat-icon-shrunk-in-button">new_releases</span>
+ override parent group permissions.
+ </span>
+ </div>
<div class="row font-weight-bold">
<div class="col-lg-5" i18n>Permissions</div>
<div class="row" *ngFor="let map of groupPermMaps()"
[ngClass]="{'bg-warning': map.isdeleted()}">
<div class="col-lg-5">
- <span i18n-title
- title="{{map.perm().description() || map.perm().code()}}">
- {{map.perm().code()}}
+ <span class="label-with-material-icon">
+ <span i18n-title title="{{map.perm().description() || map.perm().code()}}">
+ {{map.perm().code()}}
+ </span>
+ <span *ngIf="permOverrides(map)"
+ i18n-title title="Permission Overrides a Parent Group Permission"
+ class="pl-1 font-weight-bold text-danger material-icons mat-icon-shrunk-in-button"
+ i18n>new_releases</span>
</span>
</div>
<ng-container *ngIf="permIsInherited(map); else nativeMap">
this.orgDepths = depths2.sort();
}
+ // Returns maps for this group and ancestors
groupPermMaps(): IdlObject[] {
if (!this.selected) { return []; }
return m.grp().id() !== this.selected.callerData.id();
}
+ // True if the provided mapping applies to the selected group
+ // and a mapping for the same permission exists for an ancestor.
+ permOverrides(m: IdlObject): boolean {
+ const grpId = this.selected.callerData.id();
+
+ if (m.grp().id() === grpId) { // Selected group has the perm.
+
+ // See if at least one of our ancestors also has the perm.
+ return this.groupPermMaps().filter(mp => {
+ return (
+ mp.perm().id() === m.perm().id() &&
+ mp.grp().id() !== grpId
+ );
+ }).length > 0;
+ }
+
+ return false;
+ }
+
// List of perm maps that owned by perm groups which are ancestors
// of the selected group
inheritedPermissions(): IdlObject[] {