Tags:
create new tag
view all tags

Question

I built this using TopicVarsPlugin:

Web VIEW CHANGE RENAME
  DENY ALLOW DENY ALLOW DENY ALLOW
Blog ... %Blog.WebPreferences.DENYWEBVIEW% %Blog.WebPreferences.ALLOWWEBVIEW% %Blog.WebPreferences.ALLOWWEBCHANGE% %Blog.WebPreferences.DENYWEBCHANGE% %Blog.WebPreferences.DENYWEBRENAME% %Blog.WebPreferences.ALLOWWEBVIEW%
Codev ... %Codev.WebPreferences.DENYWEBVIEW% %Codev.WebPreferences.ALLOWWEBVIEW% %Codev.WebPreferences.ALLOWWEBCHANGE% %Codev.WebPreferences.DENYWEBCHANGE% %Codev.WebPreferences.DENYWEBRENAME% %Codev.WebPreferences.ALLOWWEBVIEW%
Main ... %Main.WebPreferences.DENYWEBVIEW% %Main.WebPreferences.ALLOWWEBVIEW% %Main.WebPreferences.ALLOWWEBCHANGE% %Main.WebPreferences.DENYWEBCHANGE% %Main.WebPreferences.DENYWEBRENAME% %Main.WebPreferences.ALLOWWEBVIEW%
Plugins ... %Plugins.WebPreferences.DENYWEBVIEW% %Plugins.WebPreferences.ALLOWWEBVIEW% %Plugins.WebPreferences.ALLOWWEBCHANGE% %Plugins.WebPreferences.DENYWEBCHANGE% %Plugins.WebPreferences.DENYWEBRENAME% %Plugins.WebPreferences.ALLOWWEBVIEW%
Sandbox ... %Sandbox.WebPreferences.DENYWEBVIEW% %Sandbox.WebPreferences.ALLOWWEBVIEW% %Sandbox.WebPreferences.ALLOWWEBCHANGE% %Sandbox.WebPreferences.DENYWEBCHANGE% %Sandbox.WebPreferences.DENYWEBRENAME% %Sandbox.WebPreferences.ALLOWWEBVIEW%
Support ... %Support.WebPreferences.DENYWEBVIEW% %Support.WebPreferences.ALLOWWEBVIEW% %Support.WebPreferences.ALLOWWEBCHANGE% %Support.WebPreferences.DENYWEBCHANGE% %Support.WebPreferences.DENYWEBRENAME% %Support.WebPreferences.ALLOWWEBVIEW%
TWiki ... %TWiki.WebPreferences.DENYWEBVIEW% %TWiki.WebPreferences.ALLOWWEBVIEW% %TWiki.WebPreferences.ALLOWWEBCHANGE% %TWiki.WebPreferences.DENYWEBCHANGE% %TWiki.WebPreferences.DENYWEBRENAME% %TWiki.WebPreferences.ALLOWWEBVIEW%
TWiki01 ... %TWiki01.WebPreferences.DENYWEBVIEW% %TWiki01.WebPreferences.ALLOWWEBVIEW% %TWiki01.WebPreferences.ALLOWWEBCHANGE% %TWiki01.WebPreferences.DENYWEBCHANGE% %TWiki01.WebPreferences.DENYWEBRENAME% %TWiki01.WebPreferences.ALLOWWEBVIEW%
TWiki02 ... %TWiki02.WebPreferences.DENYWEBVIEW% %TWiki02.WebPreferences.ALLOWWEBVIEW% %TWiki02.WebPreferences.ALLOWWEBCHANGE% %TWiki02.WebPreferences.DENYWEBCHANGE% %TWiki02.WebPreferences.DENYWEBRENAME% %TWiki02.WebPreferences.ALLOWWEBVIEW%
TWiki03 ... %TWiki03.WebPreferences.DENYWEBVIEW% %TWiki03.WebPreferences.ALLOWWEBVIEW% %TWiki03.WebPreferences.ALLOWWEBCHANGE% %TWiki03.WebPreferences.DENYWEBCHANGE% %TWiki03.WebPreferences.DENYWEBRENAME% %TWiki03.WebPreferences.ALLOWWEBVIEW%
TWiki04 ... %TWiki04.WebPreferences.DENYWEBVIEW% %TWiki04.WebPreferences.ALLOWWEBVIEW% %TWiki04.WebPreferences.ALLOWWEBCHANGE% %TWiki04.WebPreferences.DENYWEBCHANGE% %TWiki04.WebPreferences.DENYWEBRENAME% %TWiki04.WebPreferences.ALLOWWEBVIEW%
TWiki04x01 ... %TWiki04x01.WebPreferences.DENYWEBVIEW% %TWiki04x01.WebPreferences.ALLOWWEBVIEW% %TWiki04x01.WebPreferences.ALLOWWEBCHANGE% %TWiki04x01.WebPreferences.DENYWEBCHANGE% %TWiki04x01.WebPreferences.DENYWEBRENAME% %TWiki04x01.WebPreferences.ALLOWWEBVIEW%
TWiki04x02 ... %TWiki04x02.WebPreferences.DENYWEBVIEW% %TWiki04x02.WebPreferences.ALLOWWEBVIEW% %TWiki04x02.WebPreferences.ALLOWWEBCHANGE% %TWiki04x02.WebPreferences.DENYWEBCHANGE% %TWiki04x02.WebPreferences.DENYWEBRENAME% %TWiki04x02.WebPreferences.ALLOWWEBVIEW%
TWiki04x03 ... %TWiki04x03.WebPreferences.DENYWEBVIEW% %TWiki04x03.WebPreferences.ALLOWWEBVIEW% %TWiki04x03.WebPreferences.ALLOWWEBCHANGE% %TWiki04x03.WebPreferences.DENYWEBCHANGE% %TWiki04x03.WebPreferences.DENYWEBRENAME% %TWiki04x03.WebPreferences.ALLOWWEBVIEW%
TWiki05x00 ... %TWiki05x00.WebPreferences.DENYWEBVIEW% %TWiki05x00.WebPreferences.ALLOWWEBVIEW% %TWiki05x00.WebPreferences.ALLOWWEBCHANGE% %TWiki05x00.WebPreferences.DENYWEBCHANGE% %TWiki05x00.WebPreferences.DENYWEBRENAME% %TWiki05x00.WebPreferences.ALLOWWEBVIEW%
TWiki05x01 ... %TWiki05x01.WebPreferences.DENYWEBVIEW% %TWiki05x01.WebPreferences.ALLOWWEBVIEW% %TWiki05x01.WebPreferences.ALLOWWEBCHANGE% %TWiki05x01.WebPreferences.DENYWEBCHANGE% %TWiki05x01.WebPreferences.DENYWEBRENAME% %TWiki05x01.WebPreferences.ALLOWWEBVIEW%
TWiki06x00 ... %TWiki06x00.WebPreferences.DENYWEBVIEW% %TWiki06x00.WebPreferences.ALLOWWEBVIEW% %TWiki06x00.WebPreferences.ALLOWWEBCHANGE% %TWiki06x00.WebPreferences.DENYWEBCHANGE% %TWiki06x00.WebPreferences.DENYWEBRENAME% %TWiki06x00.WebPreferences.ALLOWWEBVIEW%
TWiki06x01 ... %TWiki06x01.WebPreferences.DENYWEBVIEW% %TWiki06x01.WebPreferences.ALLOWWEBVIEW% %TWiki06x01.WebPreferences.ALLOWWEBCHANGE% %TWiki06x01.WebPreferences.DENYWEBCHANGE% %TWiki06x01.WebPreferences.DENYWEBRENAME% %TWiki06x01.WebPreferences.ALLOWWEBVIEW%
WikiWed ... %WikiWed.WebPreferences.DENYWEBVIEW% %WikiWed.WebPreferences.ALLOWWEBVIEW% %WikiWed.WebPreferences.ALLOWWEBCHANGE% %WikiWed.WebPreferences.DENYWEBCHANGE% %WikiWed.WebPreferences.DENYWEBRENAME% %WikiWed.WebPreferences.ALLOWWEBVIEW%

| *Web* | *VIEW* || *CHANGE* || *RENAME* ||
|  | *DENY* | *ALLOW* | *DENY* | *ALLOW* | *DENY* | *ALLOW* |
%WEBLIST{format="| [[$name.WebHome][$name]] [[$name.WebPreferences][...]] | %$name.WebPreferences.DENYWEBVIEW% | %$name.WebPreferences.ALLOWWEBVIEW% | %$name.WebPreferences.ALLOWWEBCHANGE% | %$name.WebPreferences.DENYWEBCHANGE% | %$name.WebPreferences.DENYWEBRENAME% | %$name.WebPreferences.ALLOWWEBVIEW% |" webs="public"}%

Because this does not work:

Blog ...  
Codev ...  
Main ...  
Plugins ...  
Sandbox ...  
Support ...  
TWiki ...  
TWiki01 ...  
TWiki02 ...  
TWiki03 ...  
TWiki04 ...  
TWiki04x01 ...  
TWiki04x02 ...  
TWiki04x03 ...  
TWiki05x00 ...  
TWiki05x01 ...  
TWiki06x00 ...  
TWiki06x01 ...  
WikiWed ...  

%WEBLIST{format="| [[$name.WebHome][$name]] [[$name.WebPreferences][...]] | %VAR{$quotDENYWEBVIEW$quot web=$qname}% |" webs="public"}%

and neither does this:

Blog ...  
Codev ...  
Main ...  
Plugins ...  
Sandbox ...  
Support ...  
TWiki ...  
TWiki01 ...  
TWiki02 ...  
TWiki03 ...  
TWiki04 ...  
TWiki04x01 ...  
TWiki04x02 ...  
TWiki04x03 ...  
TWiki05x00 ...  
TWiki05x01 ...  
TWiki06x00 ...  
TWiki06x01 ...  
WikiWed ...  

%WEBLIST{format="| [[$name.WebHome][$name]] [[$name.WebPreferences][...]] | %VAR{"DENYWEBVIEW" web=$qname}% |" webs="public"}%

Clearly it breaks because of the quotes. SEARCH has a cumbersome $quot syntax and AttrsContrib allows different or no quotes at all.

Am I missing something, is it not possible to use the current implementation to do this without the search like the one on SiteMap?

Environment

TWiki version: TWiki.org
TWiki plugins: TWiki.org
Server OS: TWiki.org
Web server: TWiki.org
Perl version: TWiki.org
Client OS: TWiki.org
Web Browser: TWiki.org
Categories: Missing functionality

-- MartinCleaver - 23 Nov 2004

Answer

WEBLIST does not offer the vars SEARCH does (such as $quot and $percnt). That is, you can't use WEBLIST be because you can't delay the evaluation of VAR, which needs to be done for each web.

Use SEARCH instead. There are two ways to get at the variables in the format="" parameter:

  1. pattern that extracts the parameter: $pattern(.*?\* Set ALLOWWEBRENAME\s*=([^\n\r]*).*)
  2. delayed VAR that executes for each hit: $percntVAR{ \"ALLOWWEBRENAME\" web=\"$web\" }$percnt

This demo example does both, first rows with pattern, last row with VAR:

Web VIEW CHANGE RENAME
DENY ALLOW DENY ALLOW DENY ALLOW
Main ...           TWikiCommunityGroup
TWiki06x01 ...       TWikiAdminGroup   TWikiAdminGroup
Blog ...     TWikiGuest     TWikiAdminGroup, VickiBrown
Codev ...     TWikiGuest     TWikiCommunityGroup
Plugins ...     TWikiGuest     TWikiCommunityGroup
Sandbox ...           TWikiCommunityGroup
Support ...           TWikiCommunityGroup
TWiki ...     TWikiGuest     TWikiAdminGroup
TWiki01 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki02 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki03 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki04 ...       TWikiAdminGroup, CrawfordCurrie   TWikiAdminGroup
TWiki04x01 ...       TWikiAdminGroup    
TWiki04x02 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki04x03 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki05x00 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki05x01 ...       TWikiAdminGroup   TWikiAdminGroup
TWiki06x00 ...       TWikiAdminGroup   TWikiAdminGroup
WikiWed ...            

-- PeterThoeny - 10 Jan 2005

Thanks Peter.

I can't help but think that the TopicVarsPlugin syntax is much more intuitive, and after that any user would attempt to use WEBLIST. Hell, I gave up - what are newbies going to do?

Any reason why we shouldn't incorporate the TopicVarsPlugin syntax into the core?

Doing a SEARCH for the set command is IMO asking for trouble, whereas the percntVAR is just ugly.

-- MartinCleaver - 10 Jan 2005

I've published this as TWiki.SitePermissions in the hope that it is useful. This continues the TWiki.org Codev.TopicNamingStandards of naming site-topics Site*.

-- MartinCleaver - 10 Jan 2005

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2005-01-10 - MartinCleaver
 
  • 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.