We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Question

So I would like to

  • deny editing of a topic (e.g. my homepage topic DanielKabs) while still
  • allow adding and editing of a comments area.

How to?

Answer

TWiki:TWiki/AccessControl currently works on a per topic basis. A more fine-grained access control requires a drastic change of the TWiki protection model.

But rest assured, there is a solution based on a suggestion from FranzJosefSilli made in MultiEditPluginDev:

Use =

Warning: Can't find topic ""."" =, Luke!

The idea is to include portions of a topic from another topic that is locked down.

  • One topic sets the TWiki variable %ALLOWTOPICCHANGE% to limit editing to a certain user or group of users.
  • This topic uses the %INCLUDE% directive to include a second topic, which is world editable.
  • The included topic contains the comment where everybody can add to or change them.

I think, an example is appropriate to clarify things:

     DanielKabsHome
   -------------------------------------
   |                                   |
   | Welcome to my homepage            |
   |                                   |
   |                                   |
   | text...text....                   |
   | text...text....                   |
   | text...text....                   |
   |                                   |
   | Please add comments below.        |
   |                                   |
   | %INCLUDE{"DanielKabsComments"}%   |<----+
   |                                   |     |
   |                                   |     |
   | * Set ALLOWTOPICCHANGE=DanielKabs |     |
   |                                   |     |
   -------------------------------------     |
                                             |
                                             |
                                   DanielKabsComments
                             -----------------------------------
                             |                                 |
                             | You can edit comments here.     |
                             |                                 |
                             | %STARTINCLUDE%                  |
                             |                                 |
                             | % COMMENT%                      |
                             |                                 |
                             | %STOPINCLUDE%                   |
                             |                                 |
                             | Go back to DanielKabsHome.      |
                             |                                 |
                             -----------------------------------
                                           
The Page DanielKabsHome can only be changed by the user DanielKabs. Still anybody reading this topic can add comments because he sees the comment button included from DanielKabsComments. If one adds a comment, it's magically added on DanielKabsComments!

See also:


you should take it one step further and put a REDIRECT in the included topic outside of the START/STOPINCLUDE that way the "Go back to DanielKabsHome? " part is transparent and automatic. the user never sees the topic that the comment actually goes on

-- TravisBarker - 29 Apr 2005

Hello Travis, I did not find REDIRECT in the TWikiVariables. Can you point me in the right direction and I will gladly add your idea.

-- DanielKabs - 12 May 2005

You can also see this in action at http://wiki.conceptmapping.org/People/MartinCleaver

-- MartinCleaver - 29 Apr 2005

Yes, but how can you create a topic and automatically create the topic to be included?

-- AntonAylward - 01 Nov 2005

See TopicCreatePluginDev

-- PeterThoeny - 01 Nov 2005

-- JohnLuo - 16 Mar 2006

I also want to know how to redirect back here.

-- JohnLuo - 16 Mar 2006

Another option is to use a separate corresponding "Discussion" topic for each primary topic in your site. E.g., if you have a topic called Main.JohnSmith, you would also have a topic called Main.JohnSmithDiscussion. The functionality would be somewhat similar to how Wikipedia works. You would then lock down the primary topic and allow users to edit the corresponding "Discussion" topic. If this is something you might be interested in, see the following two support topics for details on how to accomplish this:

  • SectionalEditPluginVsMultiEditPlugin: this topic describes how to create a static "Discussion" tab that appears at the top of every topic. Clicking it will take you to the corresponding discussion topic or, if one hasn't been created yet, prompt you to create it.
  • ViewHyperlinksThatExcludeSpecificTextUsingWildcards: this topic describes how to create a static "Topic" tab/link at the top of each topic so you can go back to the primary topic from the corresponding "Discussion" topic.

Note: an added benefit to using this methodology is that it's compatible with the Kupu WYSIWYG editor. I found that when you edit a topic that has the %COMMENT% tag in it using the WYSIWYG editor, the Comment box/tool no longer functions. The Kupu HTML tags/code interferes with the TWiki markup language (that is, the %COMMENT% tag). The methodology I describe here, will allow you to use the WYSIWYG editor without "breaking" anything.

-- JasonVensel - 16 Mar 2006

 
Topic revision: r10 - 31 Jul 2006 - 03:09:42 - ArnaultBonafos
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback