Allow to set state as submitter in client.
This commit is contained in:
parent
286c81e007
commit
d4cc3c3720
@ -222,12 +222,14 @@
|
|||||||
<button *ngFor="let state of motion.nextStates" mat-menu-item (click)="setState(state.id)">
|
<button *ngFor="let state of motion.nextStates" mat-menu-item (click)="setState(state.id)">
|
||||||
{{ state.name | translate }} <span *ngIf="state.show_state_extension_field"> ...</span>
|
{{ state.name | translate }} <span *ngIf="state.show_state_extension_field"> ...</span>
|
||||||
</button>
|
</button>
|
||||||
<mat-divider></mat-divider>
|
<div *ngIf="perms.isAllowed('change_metadata', motion)">
|
||||||
<button mat-menu-item (click)="setState(null)" *ngIf="perms.isAllowed('change_metadata', motion)">
|
<mat-divider *ngIf="motion.nextStates.length > 0"></mat-divider>
|
||||||
<mat-icon>replay</mat-icon> {{ 'Reset state' | translate }}
|
<button mat-menu-item (click)="setState(null)">
|
||||||
</button>
|
<mat-icon>replay</mat-icon> {{ 'Reset state' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
<div *ngIf="perms.isAllowed('change_metadata', motion)">
|
<div *ngIf="perms.isAllowed('change_state', motion)">
|
||||||
<mat-basic-chip [matMenuTriggerFor]="stateMenu" [ngClass]="getStateCssColor()">
|
<mat-basic-chip [matMenuTriggerFor]="stateMenu" [ngClass]="getStateCssColor()">
|
||||||
{{ stateLabel }}
|
{{ stateLabel }}
|
||||||
</mat-basic-chip>
|
</mat-basic-chip>
|
||||||
@ -238,7 +240,7 @@
|
|||||||
<button mat-icon-button (click)="setStateExtension()"><mat-icon>check</mat-icon></button>
|
<button mat-icon-button (click)="setStateExtension()"><mat-icon>check</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!perms.isAllowed('change_metadata', motion)">
|
<div *ngIf="!perms.isAllowed('change_state', motion)">
|
||||||
<mat-basic-chip [ngClass]="getStateCssColor()"> {{ stateLabel }} </mat-basic-chip>
|
<mat-basic-chip [ngClass]="getStateCssColor()"> {{ stateLabel }} </mat-basic-chip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -108,6 +108,20 @@ export class LocalPermissionsService {
|
|||||||
motion.state.allow_submitter_edit &&
|
motion.state.allow_submitter_edit &&
|
||||||
motion.submitters.some(submitter => submitter.id === this.operator.user.id)
|
motion.submitters.some(submitter => submitter.id === this.operator.user.id)
|
||||||
);
|
);
|
||||||
|
case 'change_state':
|
||||||
|
// check also for empty ViewMotion object (e.g. if motion.id is null)
|
||||||
|
// important for creating new motion as normal user
|
||||||
|
if (!motion || !motion.id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
this.operator.hasPerms('motions.can_manage') ||
|
||||||
|
this.operator.hasPerms('motions.can_manage_metadata') ||
|
||||||
|
(motion.state &&
|
||||||
|
motion.state.allow_submitter_edit &&
|
||||||
|
motion.submitters &&
|
||||||
|
motion.submitters.some(submitter => submitter.id === this.operator.user.id))
|
||||||
|
);
|
||||||
case 'change_metadata':
|
case 'change_metadata':
|
||||||
return (
|
return (
|
||||||
this.operator.hasPerms('motions.can_manage') ||
|
this.operator.hasPerms('motions.can_manage') ||
|
||||||
|
Loading…
Reference in New Issue
Block a user