/** * Is the given user id in the given group? * * @param int $userId * @param int $groupId * @return array GalleryStatus a status code * boolean true if yes */ function isUserInGroup($userId, $groupId) { MyOOS_CoreApi::requireOnce( 'modules/core/classes/helpers/GalleryUserGroupHelper_simple.class'); return GalleryUserGroupHelper_simple::isUserInGroup($userId, $groupId); }
/** * Return a list of groups that a user belongs to. * You can specify how many userids to list, and where the windows is in the list of all users. * * @param int $userId * @param int $count the number of group ids desired * @param int $offset the start of the range * @return array GalleryStatus a status code * array group id => group name */ function fetchGroupsForUser($userId, $count = null, $offset = null) { MyOOS_CoreApi::requireOnce('modules/core/classes/helpers/GalleryUserGroupHelper_simple.class'); return GalleryUserGroupHelper_simple::fetchGroupsForUser($userId, $count, $offset); }