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

OK, so now it doesn't actually work the way that I wanted. This is completely workable, but not doing what I want.

How do I create a list of links in WebLinks that is only displayed when a certain group of people are logged in?

I tried the following...

%IFACCESS{ type="change" user="Main.TWikiAdminGroup" glue="off" then="   * %ICONURL{wrench}% [[WebPreferences][Settings]]" else="" }%
But that doesn't work at all. It's not parsed.

There must be a way for this, no? Or did I use IFDEFINED wrongly?

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian
Web server: Apache2
Perl version: 5.8.8
Client OS:  
Web Browser:  
Categories: Plugins

-- KwangErnLiew - 10 Feb 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Last night I've briefly discussed this with SvenDowideit and a good way to do this is...

1) create a RestrictedWebList and set ALLOWTOPICVIEW/DENYTOPICVIEW

2) slap it into WebLinks with an with a warn=off

3) works. Untested, yet. But I'm quite sure it works.

Why didn't I think of it in the first place... :|

-- KwangErnLiew - 11 Feb 2007

This might work out fine, but here's a shorter solution (less topics) taken from the latest NatSkin:

   * [[%TWIKIWEB%.WelcomeGuest][%MAKETEXT{"Welcome"}%]]
   * [[%TWIKIREGISTRATION%][%MAKETEXT{"Registration"}%]]
   * [[%MAINWEB%.TWikiUsers][%MAKETEXT{"Users"}%]]
   * [[%MAINWEB%.TWikiGroups][%MAKETEXT{"Groups"}%]]
   * [[%TWIKIWEB%.ChangePassword][%MAKETEXT{"Password"}%]]
%IFDEFINEDTHEN{"%IFACCESS{"%MAINWEB%.WebLinks" type="change"}%" as="1"}%
<!-- -->
   * [[%BASEWEB%.WebPreferences][%MAKETEXT{"Preferences"}%]]
   * [[%MAINWEB%.TWikiPreferences][%MAKETEXT{"SitePreferences"}%]]
%FIDEFINED%
%STOPINCLUDE%

<!--
   * DISABLED_Set ALLOWTOPICCHANGE = TWikiAdminGroup
-->

This is the definition of the WebLinks for the Main web. As you can see, it renders an extended navigation for guys in the TWikiAdminGroup. While this reduces the amount of topics that you need to generate the content of different navigations, you will still need a topic to check authorization against. In this case, this is the WebLinks topic itself. But this can be any arbitrary topic that applies the desired permissions.

-- MichaelDaum - 12 Feb 2007

 
Change status to:
Topic revision: r4 - 12 Feb 2007 - 17:46:59 - PeterThoeny
 
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