Merge pull request #4483 from tsiegleauq/motion-block-perms

Motion block permission fixes
This commit is contained in:
Emanuel Schütze 2019-03-09 21:41:12 +01:00 committed by GitHub
commit a26c44ca73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -45,7 +45,9 @@
<!-- title column --> <!-- title column -->
<ng-container matColumnDef="title"> <ng-container matColumnDef="title">
<mat-header-cell *matHeaderCellDef mat-sort-header> <span translate>Motion</span> </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> <span translate>Motion</span> </mat-header-cell>
<mat-cell *matCellDef="let motion" (click)="onClickMotionTitle(motion)"> {{ motion.title }} </mat-cell> <mat-cell *matCellDef="let motion" (click)="onClickMotionTitle(motion)">
{{ motion.getTitle() }}
</mat-cell>
</ng-container> </ng-container>
<!-- state column --> <!-- state column -->

View File

@ -122,10 +122,13 @@ export class MotionBlockListComponent extends ListViewBaseComponent<ViewMotionBl
* @returns an array of strings building the column definition * @returns an array of strings building the column definition
*/ */
public getColumnDefinition(): string[] { public getColumnDefinition(): string[] {
let columns = ['title', 'amount', 'menu']; let columns = ['title', 'amount'];
if (this.operator.hasPerms('core.can_manage_projector')) { if (this.operator.hasPerms('core.can_manage_projector')) {
columns = ['projector'].concat(columns); columns = ['projector'].concat(columns);
} }
if (this.operator.hasPerms('motions.can_manage')) {
columns = columns.concat(['menu']);
}
return columns; return columns;
} }

View File

@ -165,10 +165,14 @@
<mat-icon>device_hub</mat-icon> <mat-icon>device_hub</mat-icon>
<span translate>Categories</span> <span translate>Categories</span>
</button> </button>
</div>
<div *ngIf="perms.isAllowed('manage') || motionBlocks.length">
<button mat-menu-item routerLink="blocks"> <button mat-menu-item routerLink="blocks">
<mat-icon>widgets</mat-icon> <mat-icon>widgets</mat-icon>
<span translate>Motion blocks</span> <span translate>Motion blocks</span>
</button> </button>
</div>
<div *ngIf="perms.isAllowed('manage')">
<button mat-menu-item routerLink="statute-paragraphs" *ngIf="statutesEnabled"> <button mat-menu-item routerLink="statute-paragraphs" *ngIf="statutesEnabled">
<mat-icon>account_balance</mat-icon> <mat-icon>account_balance</mat-icon>
<span translate>Statute</span> <span translate>Statute</span>