[pmwiki-users] Limiting Group access via AuthUser groups

michael paulukonis xraysmalevich at gmail.com
Fri Nov 1 08:01:38 CDT 2013


Thanks, Petko, seems to work great!



-Michael Paulukonis
http://www.xradiograph.com
 <http://goog_2112721603>Interference Patterns (a
blog)<http://www.xradiograph.com%5Cinterference>
@XraysMonaLisa <https://twitter.com/XraysMonaLisa>
http://michaelpaulukonis.com
<http://www.BestAndroidResources.com>

Sent from somewhere in the Cloud
(hearthrug, by the fender)


On Thu, Oct 31, 2013 at 4:57 PM, Petko Yotov <5ko at 5ko.fr> wrote:

> michael paulukonis writes:
>
>> Is there a programmatic way to restrict group access?
>> I'm setting up a wiki for others to maintain, who will be creating users
>> and Groups.
>> Each Group should be restricted to one AuthUser group.
>> Ideally, the AuthUser group would have the same name as the Group.
>>
>> This would mean that once a Group is created and users are added to the
>> AuthUser group, no further action would have to be taken by the
>> administrator.
>>
>> However, I haven't figured out how to set Group restrictions without
>> using {Group}.GroupAttributes?**action=attr and manually setting the
>> group.
>>
>> Would it be possible to do something like the following in
>> local/config.php ?
>>
>> // exclude Groups like PmWiki, Main, etc.
>> if ($Group != 'Site') {
>>   $DefaultPasswords['read'] = array('@$Group', 'id:admin'); // restrict
>> to group and admin
>> }
>>
>
> Something like this may appear to work but it may unexpectedly create read
> permissions, for example via (:include...:) or via Page(Text)Variables. A
> user in one Group may use (:include OtherGroup.MainPage:) and see the
> rendered HTML of that OtherGroup.
>
> It is best to enter the user group in the GroupAttributes?action=attr
> page, or to programmatically create these pages.
>
> See the recipe http://www.pmwiki.org/wiki/**Cookbook/AutoGroupPages<http://www.pmwiki.org/wiki/Cookbook/AutoGroupPages>. You can insert inside that function something like:
>
>  $group = FmtPageName('{$Group}', $pagename);
>  $template = ReadPage('Templates.**GroupAttributes');
>  $template['passwdread'] = "@$group"; # or strtolower("@$group");
>  $template['passwdedit'] = "@$group";
>  $template['passwdattr'] = "@$group";
>  WritePage("$group.**GroupAttributes", $template);
>
> See also http://www.pmwiki.org/wiki/**PmWiki/EditVariables#**AutoCreate<http://www.pmwiki.org/wiki/PmWiki/EditVariables#AutoCreate>which may potentially be of use.
>
> Petko
>
>
> ______________________________**_________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/**mailman/listinfo/pmwiki-users<http://www.pmichaud.com/mailman/listinfo/pmwiki-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20131101/80e54542/attachment.html>


More information about the pmwiki-users mailing list