@@ 579-589 (lines=11) @@ | ||
576 | * @param integer $uid L'id de l'utilisateur à controler |
|
577 | * @return bool |
|
578 | */ |
|
579 | public function userCanSeeReference(references_articles $article, $uid = 0) |
|
580 | { |
|
581 | global $xoopsUser; |
|
582 | if ($uid == 0) { |
|
583 | $uid = references_utils::getCurrentUserID(); |
|
584 | } |
|
585 | $currentModule = references_utils::getModule(); |
|
586 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
587 | $gperm_handler = xoops_getHandler('groupperm'); |
|
588 | ||
589 | return $gperm_handler->checkRight(REFERENCES_PERM_READ, $article->article_category_id, references_utils::getMemberGroups($uid), $currentModule->getVar('mid')); |
|
590 | } |
|
591 | ||
592 | /** |
@@ 204-214 (lines=11) @@ | ||
201 | * @param integer $uid L'id de l'utilisateur à controler |
|
202 | * @return bool |
|
203 | */ |
|
204 | public function userCanSeeCategory(references_categories $category, $uid = 0) |
|
205 | { |
|
206 | global $xoopsUser; |
|
207 | if ($uid == 0) { |
|
208 | $uid = references_utils::getCurrentUserID(); |
|
209 | } |
|
210 | $currentModule = references_utils::getModule(); |
|
211 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
212 | $gperm_handler = xoops_getHandler('groupperm'); |
|
213 | ||
214 | return $gperm_handler->checkRight(REFERENCES_PERM_READ, $category->category_id, references_utils::getMemberGroups($uid), $currentModule->getVar('mid')); |
|
215 | } |
|
216 | } |
|
217 |