/** * Check if the user can access the project $group, * regarding the restricted access * * @param Object{Group} $group the Group object * @return boolean true if the current session user has access to this project, false otherwise */ function checkRestrictedAccess($group) { if (ForgeConfig::areRestrictedUsersAllowed()) { if ($group) { $user = UserManager::instance()->getCurrentUser(); if ($user) { if ($user->isRestricted()) { return $group->userIsMember(); } else { return true; } } else { return false; } } else { return false; } } else { return true; } }
/** * Check if the user can access the project $group, * regarding the restricted access * * @param Object{Group} $group the Group object * @return boolean true if the current session user has access to this project, false otherwise */ function checkRestrictedAccess($group) { if (array_key_exists('sys_allow_restricted_users', $GLOBALS) && $GLOBALS['sys_allow_restricted_users'] == 1) { if ($group) { $user = UserManager::instance()->getCurrentUser(); if ($user) { if ($user->isRestricted()) { return $group->userIsMember(); } else { return true; } } else { return false; } } else { return false; } } else { return true; } }