Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $actions = JAccess::getActionsFromFile(JPATH_COMPONENT_ADMINISTRATOR.'/access.xml');
- $user = JFactory::getUser(398);
- foreach($actions as $action) {
- $result = $user->authorize($action->name, 'com_test');
- while(is_null($result) && $action->inherit != ''){
- $filter = array_filter($actions,
- function ($var) use ($action) {
- return ($var->name == $action->inherit);
- }
- );
- $action = array_shift($filter);
- $result = $user->authorize($action->name, 'com_test');
- }
- var_dump($action, $result);
- }
Add Comment
Please, Sign In to add comment