Very, very useful extension. Thanks a LOT!
I hope you don’t mind, but I also wanted the permissions to work the other way around (as per Mark’s request) and have come up with following tweak for those that are interested until you have time to make a full update.
Change at line 257 of ext.restrict_entries.php from
foreach($SESS->cache['restricted_member_group_data']->result AS $key)
{
if ($key['entry_id'] == $row['entry_id'])
{
$groups = unserialize($key['member_groups']);
foreach($groups AS $key => $value)
{
if($SESS->userdata['group_id'] == $value)
{
$tagdata = '';
break;
}
}
}
}
to
foreach($SESS->cache['restricted_member_group_data']->result AS $key)
{
if ($key['entry_id'] == $row['entry_id'])
{
$groups = unserialize($key['member_groups']);
$ok=FALSE;
foreach($groups AS $key => $value)
{
if($SESS->userdata['group_id'] == $value)
{
$ok=TRUE;
break;
}
}
if ($ok===FALSE && $SESS->userdata['group_id']!=1){
$tagdata = '';
}
}
}
Also change line 12 of lang.restrict_entries.php from
"Select the groups that you wish to prevent from viewing this entry",
to
"Select the groups that you wish to allow to view this entry",
Super-Admins will always get to see everything.