Merge pull request #4149 from MaximilianKrambach/fixMotionPermission

fix motion change permission
This commit is contained in:
Emanuel Schütze 2019-01-19 21:09:00 +01:00 committed by GitHub
commit c26daad07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

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

View File

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