fix motion change permission

This commit is contained in:
Maximilian Krambach 2019-01-19 19:01:44 +01:00
parent df85e01b16
commit 30d8812719
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<os-head-bar
[mainButton]="perms.isAllowed('update_motion', motion)"
[mainButton]="perms.isAllowed('update', motion)"
mainButtonIcon="edit"
[nav]="false"
[editMode]="editMotion"

View File

@ -82,9 +82,10 @@ export class LocalPermissionsService {
return false;
}
return (
this.operator.hasPerms('motions.can_manage') &&
motion.state.allow_submitter_edit &&
motion.submitters.some(submitter => submitter.id === this.operator.user.id)
this.operator.hasPerms('motions.can_manage') ||
(motion.state.allow_submitter_edit &&
motion.submitters &&
motion.submitters.some(submitter => submitter.id === this.operator.user.id))
);
case 'update_submitters':
return this.operator.hasPerms('motions.can_manage');