Merge pull request #4813 from tsiegleauq/remove-restriction-for-filter

Remove restrictions for filters
This commit is contained in:
Emanuel Schütze 2019-06-27 22:38:28 +02:00 committed by GitHub
commit a63891e98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,10 +212,9 @@ export class MotionFilterListService extends BaseFilterListService<ViewMotion> {
}); });
for (const state of workflow.states) { for (const state of workflow.states) {
if ( // get the restriction array, but remove the is_submitter condition, if present
this.operator.hasPerms('motions.can_manage', 'motions.can_manage_metadata') && const restrictions = state.restriction.filter(r => r !== 'is_submitter');
state.restriction if (!restrictions.length || this.operator.hasPerms(...restrictions)) {
) {
// sort final and non final states // sort final and non final states
state.isFinalState ? finalStates.push(state.id) : nonFinalStates.push(state.id); state.isFinalState ? finalStates.push(state.id) : nonFinalStates.push(state.id);