[pmwiki-users] Groups and read/edit/write access

Peter van Es vanes.peter at gmail.com
Fri Apr 24 11:22:59 PDT 2026


Thanks Petko,

I have the logging in working using a version of the database recipe you provided. Now I’m struggling with the next challenge.
Maybe it is because I do not know how $authlist is meant to look/work...

Most of my wiki will be available only to signed in users. So when people sign in my code (authuser_LB.php) adds:

    # success
    # set user groups: everyone logged in can read
    $authlist['@read'] = 1;

However, for certain users I want to add group rights.. (like for me, admin) (role_in is case insensitive string compare against an array of functions and returns true if any of them match):

    # check role and functions
    $admins = ['Chairperson ICT', 'Administrative Secretary', 'Ambtelijk Secretaris']; 
    # admins are ICT and ASMD
    if (role_in($role, $admins)) {
        $authlist['@admin'] = 1;
    }

This appears to work. Although I’m not entirely sure, as I added my login username to the Site/AuthUser page as an admin:
@admins: xxxx at xxxxx.com <mailto:xxxx at xxxxx.com>  so that might override it…

Now I have a Group on my wiki which I only want members of the group (and me, as admin) to read, edit, upload etc. So I added a statement like:

	$gr = ['District governor', 'MD council chairperson', 'MD general secretary', 'MD treasurer’,
	'MD Opvolgend council chairperson', 'MD vice council chairperson', 'MD Governor council member’];
	if (role_in($role, $gr)) {
		$authlist['@gr'] = 1;
		$authlist['@edit'] = 1;
	}

Then I tried to add to the page Group.Start access restrictions using Group.GroupAttributes?action=attr and adding @gr to all of the access control fields (read, edit, attr and upload). 

After doing that, the group / page became completely inaccessible to me (logged in, and should be at admin level). I tried to add 

		$authlist['@gr'] = 1;

To my own authlist, but even that did not give me access. Where am I misunderstanding the way this is meant to work?

Thanks for your help...

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20260424/0228cd8d/attachment.html>


More information about the pmwiki-users mailing list