3

Is it possible to froze state changing for an given object based on a condition?

What I have:

  • meetings (like events)
  • subscribers (participants in meetings)
  • the subscribers can be approved or not

What I need:

  • the subscribers of old meetings to have the state frozen (nobody to change an approved one to not approved etc).

Can you suggest a solution for this case?

GhitaB
  • 3,275
  • 3
  • 33
  • 62
  • I posted a link to your question on our forum. Please remember that you will get more people viewing and possibly answering if you post questions directly on the Plone forum rather than here! https://community.plone.org/t/stack-overflow-plone-froze-state-changing-for-an-object-conditioned/4030 – T. Kim Nguyen Apr 18 '17 at 18:03

1 Answers1

2

The solution was to use a transition guard: https://docs.plone.org/4/en/old-reference-manuals/archgenxml/basic-features/workflows.html?highlight=guard#transition-guards

I used as an expression python:here.is_allowed_state_change() is True.

I defined is_allowed_state_change to return True if the meeting is not ended.

GhitaB
  • 3,275
  • 3
  • 33
  • 62