[pmwiki-users] Find out users authorization in PHP when loading page

Patrick R. Michaud pmichaud at pobox.com
Mon Feb 20 17:47:52 CST 2012


On Tue, Feb 21, 2012 at 12:04:48AM +0100, Thomas Lundgren wrote:
> Help! :)
> 
> I´m trying to find a way to (in PHP) check if the user that makes
> PmWiki load a page are authorized to edit that particular page.

The CondAuth() function does what you want:

    if (CondAuth($pagename, 'edit')) { ... }

You can provide either authorization levels ('read', 'edit', 
'attr', 'admin') or action names ('browse', 'upload', 'source')
as the second argument to CondAuth().

Hope this helps,

Pm



More information about the pmwiki-users mailing list