Question
I would like to have a user create a topic and then limit edit permission to a admin group and the creator. So I put in a access statement in the topic that includes a field from a form that holds the creators name.
-
Set ALLOWTOPICCHANGE = Main.RequirementToolAdminGroup, %FORMFIELD{"Creator"}%
When the page is display the result looks fine, user name is in the set command. However, the user cannot edit, change authorization fails. If I edit the page and type in the user name works fine.
Any thoughts!
Environment
--
TimBacon - 19 Dec 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Set this in the template topic:
-
Set ALLOWTOPICCHANGE = Main.RequirementToolAdminGroup, %WIKIUSERNAME%
Read more at
TWikiAccessControl,
VarWIKIUSERNAME,
TWikiTemplates
--
PeterThoeny - 19 Dec 2008
Thanks, I will give it a try. However, Main.TimBacon is what is in the form field already, so it seems like the result should be the same. Also, I have another field in the form which is another wiki Username that should get edit access. Is there a problem use a form field in this manor?
Any recommend books on twiki application development, the documentation is a good reference but I seem to be missing some fundamental logic in a number of places.
Thanks for all the assistance!
--
TimBacon - 20 Dec 2008
I forgot an important aspect, the set command is actually in a topic template that gets used to create the topic, when the creator files out a form.
--
TimBacon - 20 Dec 2008
Only certain variables are expanded when instantiating a page from a template topic, see
TWikiTemplates. An undocumented
ControlOverVariableExpansion feature allows you to have control over expansion of other variables.
In your case you could query the form field values and pass it on as URL parameters into the template topic.
VarURLPARAM are expanded at page instantiation time.
On getting up to speed, look into the
WikisForDummiesBook, it has a chapter on creating wiki applications. Look also into
TWiki training
.
--
PeterThoeny - 20 Dec 2008
I see, so
TimBacon is perfect for giving the creator permission to edit the page. The other user is a field in a form and at instantiation of the template is not yet populated. In addition, it can be changed. How might I make a change to the SET command?
--
TimBacon - 20 Dec 2008
-
Set ALLOWTOPICCHANGE = Main.RequirementToolAdminGroup, %WIKIUSERNAME%, %URLPARAM{other}%
You can submit a
other=Main.SomeWikiName URL parameter, which can be supplied by the form that asks for these values.
--
PeterThoeny - 20 Dec 2008
Yes this lets me pass an intial value to the be used. But I need the value to change. The creator of the topic needs to be able to delegate edit permission to another individual. Right now that is done in a form field. If I use the above set I don't see how I can change it later.
--
TimBacon - 20 Dec 2008
The ALLOWTOPICCHANGE values need to be hardcoded, they can't be dynamic. That is, it is currently not possible to change it based on form field values.
--
PeterThoeny - 21 Dec 2008
Thanks for working me through this and sorry it took so many iterations to help me. Your assistance is greatly appreciated.
--
TimBacon - 21 Dec 2008
Your very welcome. If you need this functionality you need to write a plugin in Perl. See
TWikiPlugins.
--
PeterThoeny - 21 Dec 2008