Tags:
create new tag
view all tags

SID-02462: How to allow write access but not read access to a topic

Status: Answered Answered TWiki version: 6.1.0 Perl version: 5
Category: CategoryApplications Server OS: CC7 Last update: 5 years ago

Hello

I am trying to create a form such that a user can write a comment into a results topic but is not allowed to view all the results in the results topic.

The goal is to keep all comments anonymous

I have created a template using the comment plugin that saves just the date and the comment but if I block view access to the result topic then the comment plugin no longer works as the user does not have access.

I could use a form to save all results to separate topics but I hope this wont be necessary.

Anyone had experience with this?

Thanks for any feedback

-- Peter Jones - 2020-12-14

Discussion and Answer

I checked, indeed, the CommentPlugin has a TWiki::Func::checkAccessPermission() to enforce write permission, as it should.

You could write a AnonymousFeedbackPlugin that does not check write permission, and uses a TWiki::Func::readTopicText(), modify, TWiki::Func::saveTopicText() sequence. That save function can optionally ignore write permissions. Note that anonymity is not given because the revision info contains the person info.

A better approach is that the AnonymousFeedbackPlugin stores the feedback in the plugin's working directory as a file, using a TWiki::Func::getWorkArea(), TWiki::Func::readFile(), append, TWiki::Func::saveFile() sequence. That protects the anonymity as long as the plugin does not log activity. Save could be done with a REST call using Ajax.

Alternatively your feedback form could have an action to point to the topic itself (view), and have an input field named afcomment for the comment, and a hidden field named afaction with value save. On submit an embedded %ANONYMOUSFEEDBACK{ "bike-shed-color" action="%URLPARAM{afaction}%" comment=%URLPARAM{afcomment}% }% variable would take the action to save the topic. The "bike-shed-color" would be used as the name of the poll.

A %ANONYMOUSFEEDBACK{ "bike-shed-color" }% variable would return all feedback on the bike shed color poll. It could be protected that only members of a certain group can get the result.

-- Peter Thoeny - 2020-12-15

I vaguely recall that I wanted to do a similar thing some years ago...

The simple approach is to use CommentPlugin with the parameters type=return (so that it returns to the page with the comment form) and target=ResultsPage (so that the comment goes to the topic ResultsPage). However, it doesn't work to deny read access to ResultsPage as desired: Apparently somewhere in the process there's a check for read access permission as well (at least that's what my recent experiment suggests). So this works to hide the results page a bit, but doesn't make it inaccessible.

I guess one could whip something up to set target=ResultsPageXXXXXXXXXX and allow read access for the creator of these topic. This still needs fiddling with the template, though. The "true" results page would then be a search over this set of pages. More important, every author would see his own comments in the same search, which I think is nice.

-- Harald Jörg - 2020-12-16

Harald has a good idea, essentially to create a TWikiApplication. Each form submit creates a new topic, e.g. one topic per comment. TWiki allows creating a topic and setting access control at the same time. If the new topic is view access restricted to the person submitting the form, the person can see a report listing all his/her comments, and nobody else besides TWiki admins can see them.

-- Peter Thoeny - 2020-12-17

Possibly the (older) PollPlugin fits your needs?

-- Peter Thoeny - 2020-12-20

I created a AnonymousFeedbackPluginDev brainstorming idea topic, let's follow up there.

-- Peter Thoeny - 2020-12-20

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title How to allow write access but not read access to a topic
SupportCategory CategoryApplications
TWiki version 6.1.0
Server OS CC7
Web server apache
Perl version 5
Browser & version FF, Chrome
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2020-12-20 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.