Fixes permissions for motion-blocks

- Only users with permission `motions.can_manage` can remove motions from motion-block.
This commit is contained in:
GabrielMeyer 2019-09-04 12:04:33 +02:00
parent fffbf95a63
commit bd9d93061d
2 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,7 @@
[repo]="motionRepo"
[filterService]="filterService"
[columns]="tableColumnDefinition"
[restricted]="restrictedColumns"
[filterProps]="filterProps"
(dataSourceChange)="onDataSourceChange($event)"
>

View File

@ -14,6 +14,7 @@ import { MotionBlockRepositoryService } from 'app/core/repositories/motions/moti
import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service';
import { PromptService } from 'app/core/ui-services/prompt.service';
import { ViewportService } from 'app/core/ui-services/viewport.service';
import { ColumnRestriction } from 'app/shared/components/list-view-table/list-view-table.component';
import { MotionBlock } from 'app/shared/models/motions/motion-block';
import { infoDialogSettings } from 'app/shared/utils/dialog-settings';
import { BaseListViewComponent } from 'app/site/base/base-list-view';
@ -71,6 +72,15 @@ export class MotionBlockDetailComponent extends BaseListViewComponent<ViewMotion
width: '40px'
}
];
/**
* Restrictions for specific columns
*/
public restrictedColumns: ColumnRestriction[] = [
{
columnName: 'remove',
permission: 'motions.can_manage'
}
];
/**
* The form to edit blocks