Merge pull request #4638 from FinnStutzenstein/fixRestrictionCheck
Fix restriction check for motions
This commit is contained in:
commit
78c77efd7c
@ -46,10 +46,12 @@ class MotionAccessPermissions(BaseAccessPermissions):
|
||||
|
||||
if not permission:
|
||||
# Parse values of restriction field.
|
||||
# If at least one restriction is ok, permissions are granted.
|
||||
for value in restriction:
|
||||
if value == "managers_only":
|
||||
# permission remains false
|
||||
break
|
||||
# permission remains false, becuase the user does not
|
||||
# have this permission (see above); continue to check other fields
|
||||
continue
|
||||
elif value in (
|
||||
"motions.can_see_internal",
|
||||
"motions.can_manage_metadata",
|
||||
|
@ -568,6 +568,11 @@ class MotionViewSet(TreeSortMixin, ModelViewSet):
|
||||
)
|
||||
message = f"The state of the motion was set to {motion.state.name}."
|
||||
|
||||
# Send submitters and supporters via autoupdate because users without
|
||||
# users.can_see may see them now.
|
||||
inform_changed_data(map(lambda s: s.user, motion.submitters.all()))
|
||||
inform_changed_data(motion.supporters.all())
|
||||
|
||||
# Fire autoupdate again to save information to OpenSlides history.
|
||||
inform_changed_data(
|
||||
motion,
|
||||
@ -642,6 +647,11 @@ class MotionViewSet(TreeSortMixin, ModelViewSet):
|
||||
skip_autoupdate=True,
|
||||
)
|
||||
|
||||
# Send submitters and supporters via autoupdate because users without
|
||||
# users.can_see may see them now.
|
||||
inform_changed_data(map(lambda s: s.user, motion.submitters.all()))
|
||||
inform_changed_data(motion.supporters.all())
|
||||
|
||||
# Fire autoupdate again to save information to OpenSlides history.
|
||||
inform_changed_data(
|
||||
motion,
|
||||
|
Loading…
Reference in New Issue
Block a user