<div dir="ltr">Thanks, Petko, seems to work great!<br><br><br></div><div class="gmail_extra"><br clear="all"><div>-Michael Paulukonis<br><a href="http://www.xradiograph.com" target="_blank">http://www.xradiograph.com</a><br>

<a href="http://goog_2112721603" target="_blank"></a><a href="http://www.xradiograph.com%5Cinterference" target="_blank">Interference Patterns (a blog)</a><br><a href="https://twitter.com/XraysMonaLisa" target="_blank">@XraysMonaLisa</a><br>

<a href="http://michaelpaulukonis.com" target="_blank">http://michaelpaulukonis.com</a><br><a href="http://www.BestAndroidResources.com" target="_blank"></a><br><br>Sent from somewhere in the Cloud<br>(hearthrug, by the fender)<br>

</div>
<br><br><div class="gmail_quote">On Thu, Oct 31, 2013 at 4:57 PM, Petko Yotov <span dir="ltr"><<a href="mailto:5ko@5ko.fr" target="_blank">5ko@5ko.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">michael paulukonis writes:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a programmatic way to restrict group access?<br>
I'm setting up a wiki for others to maintain, who will be creating users and Groups.<br>
Each Group should be restricted to one AuthUser group.<br>
Ideally, the AuthUser group would have the same name as the Group.<br>
<br>
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.<br>
<br>
However, I haven't figured out how to set Group restrictions without using {Group}.GroupAttributes?<u></u>action=attr and manually setting the group.<br>
<br>
Would it be possible to do something like the following in local/config.php ?<br>
<br>
// exclude Groups like PmWiki, Main, etc.<br>
if ($Group != 'Site') {<br>
  $DefaultPasswords['read'] = array('@$Group', 'id:admin'); // restrict to group and admin<br>
}<br>
</blockquote>
<br></div>
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.<br>


<br>
It is best to enter the user group in the GroupAttributes?action=attr page, or to programmatically create these pages.<br>
<br>
See the recipe <a href="http://www.pmwiki.org/wiki/Cookbook/AutoGroupPages" target="_blank">http://www.pmwiki.org/wiki/<u></u>Cookbook/AutoGroupPages</a> . You can insert inside that function something like:<br>
<br>
 $group = FmtPageName('{$Group}', $pagename);<br>
 $template = ReadPage('Templates.<u></u>GroupAttributes');<br>
 $template['passwdread'] = "@$group"; # or strtolower("@$group");<br>
 $template['passwdedit'] = "@$group";<br>
 $template['passwdattr'] = "@$group";<br>
 WritePage("$group.<u></u>GroupAttributes", $template);<br>
<br>
See also <a href="http://www.pmwiki.org/wiki/PmWiki/EditVariables#AutoCreate" target="_blank">http://www.pmwiki.org/wiki/<u></u>PmWiki/EditVariables#<u></u>AutoCreate</a> which may potentially be of use.<br>
<br>
Petko<br>
<br>
<br>
______________________________<u></u>_________________<br>
pmwiki-users mailing list<br>
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/<u></u>mailman/listinfo/pmwiki-users</a><br>
</blockquote></div><br></div>