You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I would like to check if a post is at least a member of one group
currently I'm using a function looks like this, but I feel it is overwhelming
function checkPostAccessibility(int $postId): bool
{
global $userAccessManager;
$locked = false;
if (isset($userAccessManager)) {
$userAccessManagerGroups = $userAccessManager->getUserGroupHandler()->getFilteredUserGroups();
if ($userAccessManagerGroups) {
foreach ($userAccessManagerGroups as $userAccessManagerGroup) {
if ($userAccessManagerGroup->isObjectMember('post', $postId)) {
$locked = true;
break;
}
}
}
}
return $locked;
}
The text was updated successfully, but these errors were encountered:
bahaa-almahamid
changed the title
A way to check if a post is a part of on group at least
A way to check if a post is at least part of one group
Mar 22, 2022
Hi, I would like to check if a post is at least a member of one group
currently I'm using a function looks like this, but I feel it is overwhelming
The text was updated successfully, but these errors were encountered: