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 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.

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:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-02-12 - 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.