[pmwiki-users] Site.AuthUser @groups

Patrick R. Michaud pmichaud at pobox.com
Wed Jan 25 08:17:02 CST 2006


On Wed, Jan 25, 2006 at 10:44:21AM +0100, OBUTEX / Hladůvka wrote:
> In Site.AuthUser I defined groups
> @staffwarehouse: John,Tom
> @staffbookkeepers:Ivan,Marie
> 
> and in a certain page I need to show the contents according to the group.
> How can I do it ? The following does not work:
> 
> (:if @staffwarehouse:)info for warehouse
> (:if @staffbookkeepers:)info for bookkeepers
> (:if:)

PmWiki doesn't have this capability "out of the box".  But
if you want to add it, then put the following in config.php:

    $Conditions['member'] = '@$GLOBALS["AuthList"][$condparm] > 0';

Then you can do:

   (:if member @staffwarehouse:)info for warehouse
   (:if member @staffbookkeepers:)info for bookkeepers
   (:if:)

The above "member" condition also works to identify specific 
usernames, thus

   (:if member id:alice :)Hello, Alice
   (:if member id:bob   :)Hello, Bob
   (:if member @editors :)You're allowed to edit pages
   ...

Pm




More information about the pmwiki-users mailing list