This question about Using an extension: Asked
Changing Access Control with SetVariablePlugin
I want create a topic with a buttom where users initially allowed to change a topic can take away their write permission themselves. I need this as kind of workflow approval - once users have approved this topic they should not be able anymore to change the content. To get there I was looking for the SetVariablePlugin
To do so I grant change permissions for allowed approves by adding the following Access Control settings in the topic preferences:
* Set ALLOWTOPICCHANGE = TopicApproverGroup
On the topic body I create an approve button by adding this code
<form action="/bin/save/Support/Question1339" method="post">
<input type="hidden" name="Set+STATUS" value="approved"/>
<input type="hidden" name="Set+APPROVER" value="WikiGuest"/>
<input type="hidden" name="Set+APPROVERDATE" value="10 May 2019 - 15:09" />
<input type="hidden" name="Unset+ALLOWTOPICCHANGE"/>
<input type="submit" value="Approve"/>
The first 3 "Set+" statements are used to keep record about the status and who approved at what date. The "Unset+" statement is used to remove variable ALLOWTOPICCHANGE which effectively takes away write permissons for the allowed approvers group.
The page renders fine and I can press the button "approve". But instead of getting back to that page in view-only mode the error message "Access check on <Topic> failed. Action "CHANGE": access not allowed on web." appears.
But nevertheless was all done as expected. The preferences are looking like below:
* Set STATUS = approved
* Set APPROVER = MathiasContractorWindt
* Set APPROVERDATE = 07 Aug 2013 - 11:07
This is at the end exactly what I want archieve with this. Variables STATUS, APPROVER and APPROVERDATE are set and the "ALLOWTOPICCHANGE" is gone. But how do I prevent the permission error?
| Subject || Using an extension |
| Extension || SetVariablePlugin |
| Version || Foswiki 1.1.8 |
| Status || Asked |
| Related Topics || |