Enable meta groups in Model\Group::getIdsByContactId
- Don't return early if contact isn't part of any group in PermissionSet::get
This commit is contained in:
parent
353dab166e
commit
ebf60cee33
|
@ -117,6 +117,16 @@ class Group
|
||||||
}
|
}
|
||||||
DBA::close($stmt);
|
DBA::close($stmt);
|
||||||
|
|
||||||
|
// Meta-groups
|
||||||
|
$contact = Contact::getById($cid, ['rel']);
|
||||||
|
if ($contact['rel'] == Contact::FOLLOWER || $contact['rel'] == Contact::FRIEND) {
|
||||||
|
$return[] = self::FOLLOWERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($contact['rel'] == Contact::FRIEND) {
|
||||||
|
$return[] = self::MUTUALS;
|
||||||
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,14 +82,9 @@ class PermissionSet
|
||||||
$groups = Group::getIdsByContactId($contact_id);
|
$groups = Group::getIdsByContactId($contact_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($groups) || !is_array($groups)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$group_str = '<<>>'; // should be impossible to match
|
$group_str = '<<>>'; // should be impossible to match
|
||||||
|
foreach ($groups as $group_id) {
|
||||||
foreach ($groups as $g) {
|
$group_str .= '|<' . preg_quote($group_id) . '>';
|
||||||
$group_str .= '|<' . intval($g) . '>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact_str = '<' . $contact_id . '>';
|
$contact_str = '<' . $contact_id . '>';
|
||||||
|
|
Loading…
Reference in a new issue