Tags:
create new tag
view all tags

Question

I'm trying to locate the files that hold the messages a user sees when they try to access a topic or web for which they do not have view rights. The message for the web access appears to be an oops template (but I can't see which one) and the message for the topic seems to be standard text returned as if within a topic page.

Environment

TWiki version: TWikiRelease01Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux
Web server: Apache
Perl version: 5.005
Client OS:  
Web Browser:  
Categories: Permissions

-- SueLocke - 02 Apr 2005

Answer

Have just found the oops template for the allow web view error message. Still on the hunt for the allow topic view error message template/source file.

-- SueLocke - 02 Apr 2005

oopaccessview.tmpl

All the messages should be in oops templates, though it is hard to reverse engineer which ones, sometimes. If you can read perl, you can play detective and start at TWiki/UI/View.pm, and work it out that way. Search for getOopsUrl.

-- CrawfordCurrie - 03 Apr 2005

Thanks Crawford. I've got the oopsaccessview.tml OK - from what I can see of its application on my TWiki it seems to be limited to managing the user message for webs that have allowwebview privileges set, even though its text implies that it may be applicable to topics.

However, the user message for an allowtopicview setting doesn't come as a "normal" oops type message - it comes in as a message on a "normal" topic page - the message looks like this :

No permission to read topic nameoftopic - perhaps you need to log in?

So I too thought the message might have been held in a file like View.pm and had checked there (and fiddled a bit without success). No luck although there is a section there of course re access permissions for a topic. The section is like this:

 # check access permission
  my $viewAccessOK = &TWiki::Access::checkAccessPermission( "view", $wikiUserName, $text, $topic, $webName );

  if( (!$topicExists) || $TWiki::readTopicPermissionFailed ) {
    # Can't read requested topic and/or included (or other accessed topics
    # user could not be authenticated, may be not logged in yet?
    my $viewauthFile = $ENV{'SCRIPT_FILENAME'};
    $viewauthFile =~ s|/view|/viewauth|o;
    if( ( ! $query->remote_user() ) && (-e $viewauthFile ) ) {
      # try again with authenticated viewauth script
      # instead of non authenticated view script
      my $url = $ENV{"REQUEST_URI"};
      if( $url && $url =~ m|/view| ) {
        # $url i.e. is "twiki/bin/view.cgi/Web/Topic?cms1=val1&cmd2=val2"
        $url =~ s|/view|/viewauth|o;
        $url = "$TWiki::urlHost$url";
      etc

I've reached the end of my perl detective capabilities and can't work out what this might mean in relation to the source of the text for the user message.

-- SueLocke - 03 Apr 2005

Is this perhaps a bug? - that is the oopsaccessview.tmpl IS the oops message that should be called for both the web and topic allow view settings. But in the case of the allowtopicview setting it is not being called. I've tested this on both a Sept 1 04 with patch, and a Sept 02 04 installation. I'm getting the same response on both.

-- SueLocke - 05 Apr 2005

No, it's not a bug, but as features go it's a really, really nasty one. The error handling in Cairo is rather crude, and the message you are seeing is generated in the bowels of the store code. Really it should never be generated, but it is, sometimes, usually when you INCLUDE a topic you don't have view access to or otherwise reference a restricted topic.

Anyway, the file in question is lib/TWiki/Store.pm

grep 'No permission' `find /home/twiki -name '*' -print`
where /home/twiki is your installation dir.

-- CrawfordCurrie - 06 Apr 2005

Thanks Crawford. Hopefully Dakar will address error handling as part of the continuous improvement of TWiki processes. Thanks to all those involved in this work. From the sidelines I appreciate it.

-- SueLocke - 06 Apr 2005

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-04-06 - SueLocke
 
  • 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.