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 -->
<ng-container matColumnDef="title">
<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>
<!-- state column -->

View File

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

View File

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