| Conditions | 4 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function getAuthorizedCat($user, $perm) |
||
| 44 | { |
||
| 45 | static $authorizedCat; |
||
| 46 | $userId = $user ? $user->getVar('uid') : 0; |
||
| 47 | if (!isset($authorizedCat[$perm][$userId])) { |
||
| 48 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
||
| 49 | $groupPermHandler = \xoops_getHandler('groupperm'); |
||
| 50 | /** @var \XoopsModuleHandler $moduleHandler */ |
||
| 51 | $moduleHandler = \xoops_getHandler('module'); |
||
| 52 | $module = $moduleHandler->getByDirname('extcal'); |
||
| 53 | if (!$module) { |
||
| 54 | return false; |
||
| 55 | } |
||
| 56 | $authorizedCat[$perm][$userId] = $groupPermHandler->getItemIds($perm, $this->getUserGroup($user), $module->getVar('mid')); |
||
| 57 | } |
||
| 58 | |||
| 59 | return $authorizedCat[$perm][$userId]; |
||
| 60 | } |
||
| 76 |