[pmwiki-users] Checking permissions in the template?

Ryan R. Varick rvarick at gmail.com
Fri Jun 30 15:56:02 CDT 2006


Perhaps this is a simple question, but I haven't found a solution yet.
 Essentially what I want to do is a (:if auth edit:)... at the
*template* level.  Specifically, I only want the edit link to be
visible if the user has permission to edit the page.

I see that PmWiki kind of does this by including PageActions.  I tried
this approach first, but PmWiki wraps the link in <p> tags, which
breaks the container I need to put this link in.

So now I am at the template level.  I could use ReadPage on the
current page and the GroupAttributes page, but that seems overkill.
Is there a way to get at the current permissions for a page?  I need
some way of saying:

if(USER_CAN_EDIT) $MyEditFmt="{$Name}?action=edit"
else $MyEditFmt = '';

Surely there's an easier way than what I'm doing...

Thanks,

Ryan




More information about the pmwiki-users mailing list