Groups and read/edit/write access
Peter van Es <[email protected]> Fri, 24 Apr 2026 20:22:59 +0200
| Newsgroups | gmane.comp.web.wiki.pmwiki.user |
|---|---|
| Message-ID | <[email protected]> |
--===============5642218810812793022==
Content-Type: multipart/alternative;
boundary="Apple-Mail=_58A12817-8344-4713-8BCF-D6587F1A8977"
--Apple-Mail=_58A12817-8344-4713-8BCF-D6587F1A8977
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Thanks Petko,
I have the logging in working using a version of the database recipe you =
provided. Now I=E2=80=99m 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'] =3D 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 =3D ['Chairperson ICT', 'Administrative Secretary', =
'Ambtelijk Secretaris'];=20
# admins are ICT and ASMD
if (role_in($role, $admins)) {
$authlist['@admin'] =3D 1;
}
This appears to work. Although I=E2=80=99m not entirely sure, as I added =
my login username to the Site/AuthUser page as an admin:
@admins: [email protected] <mailto:[email protected]> so that might override =
it=E2=80=A6
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 =3D ['District governor', 'MD council chairperson', 'MD =
general secretary', 'MD treasurer=E2=80=99,
'MD Opvolgend council chairperson', 'MD vice council =
chairperson', 'MD Governor council member=E2=80=99];
if (role_in($role, $gr)) {
$authlist['@gr'] =3D 1;
$authlist['@edit'] =3D 1;
}
Then I tried to add to the page Group.Start access restrictions using =
Group.GroupAttributes?action=3Dattr and adding @gr to all of the access =
control fields (read, edit, attr and upload).=20
After doing that, the group / page became completely inaccessible to me =
(logged in, and should be at admin level). I tried to add=20
$authlist['@gr'] =3D 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=
--Apple-Mail=_58A12817-8344-4713-8BCF-D6587F1A8977
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html aria-label=3D"message body"><head><meta http-equiv=3D"content-type" =
content=3D"text/html; charset=3Dutf-8"></head><body =
style=3D"overflow-wrap: break-word; -webkit-nbsp-mode: space; =
line-break: after-white-space;">Thanks Petko,<div><br></div><div>I have =
the logging in working using a version of the database recipe you =
provided. Now I=E2=80=99m struggling with the next =
challenge.</div><div>Maybe it is because I do not know how $authlist is =
meant to look/work...</div><div><br></div><div>Most of my wiki will be =
available only to signed in users. So when people sign in my code =
(authuser_LB.php) adds:</div><div><br></div><div><div><font face=3D"Andale=
Mono"> # success</font></div><div><font face=3D"Andale =
Mono"> # set user groups: everyone logged in can =
read</font></div><div><font face=3D"Andale Mono"> =
$authlist['@read'] =3D 1;</font></div></div><div><br></div><div>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):</div><div><br></div><div><div><font face=3D"Andale Mono"> =
# check role and functions</font></div><div><font face=3D"Andale =
Mono"> $admins =3D ['Chairperson ICT', 'Administrative =
Secretary', 'Ambtelijk Secretaris']; </font></div><div><font =
face=3D"Andale Mono"> # admins are ICT and =
ASMD</font></div><div><font face=3D"Andale Mono"> if =
(role_in($role, $admins)) {</font></div><div><font face=3D"Andale =
Mono"> $authlist['@admin'] =3D =
1;</font></div><div><font face=3D"Andale Mono"> =
}</font></div></div><div><br></div><div>This appears to work. Although =
I=E2=80=99m not entirely sure, as I added my login username to the =
Site/AuthUser page as an admin:</div><div>@admins: <a =
href=3D"mailto:[email protected]">[email protected]</a> so that might =
override it=E2=80=A6</div><div><br></div><div>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:</div><div><br></div><div><font face=3D"Andale Mono"><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>$gr =3D =
['District governor', 'MD council chairperson', 'MD general secretary', =
'MD treasurer=E2=80=99,</font></div><div><span class=3D"Apple-tab-span" =
style=3D"font-family: "Andale Mono"; white-space: pre;"> =
</span><font face=3D"Andale Mono">'MD Opvolgend council chairperson', =
'MD vice council chairperson', 'MD Governor council =
member=E2=80=99];</font></div><div><span style=3D"font-family: =
"Andale Mono";"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>if (role_in($role, $gr)) =
{</span></div><div><span style=3D"font-family: "Andale =
Mono";"><span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>$authlist['@gr'] =3D 1;</span></div><div><span =
style=3D"font-family: "Andale Mono";"><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>$authlist['@edit'] =3D 1;</span></div><div><span =
style=3D"font-family: "Andale Mono";"><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>}</span></div><div><br></div><div>Then I tried to add to the page =
Group.Start access restrictions =
using Group.GroupAttributes?action=3Dattr and adding @gr to all of =
the access control fields (read, edit, attr and =
upload). </div><div><br></div><div>After doing that, the group / =
page became completely inaccessible to me (logged in, and should be at =
admin level). I tried to add </div><div><br></div><div><div><span =
style=3D"font-family: "Andale Mono";"><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>$authlist['@gr'] =3D 1;</span></div></div><div><br></div><div>To =
my own authlist, but even that did not give me access. Where am I =
misunderstanding the way this is meant to =
work?</div><div><br></div><div>Thanks for your =
help...</div><div><br></div><div>Peter</div></body></html>=
--Apple-Mail=_58A12817-8344-4713-8BCF-D6587F1A8977--
--===============5642218810812793022==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users
--===============5642218810812793022==--