public function hasAccess(MenuAction $action, common_user_User $user, array $node){

        $resolvedAction = $this->getResolvedAction($action);
        if(!is_null($resolvedAction) && !is_null($user)){
            if($node['type'] = $resolvedAction['context'] || $resolvedAction['context'] == 'resource') {
                foreach($resolvedAction['required'] as $key){
                    if(!array_key_exists($key, $node)){
                        //missing required key
                        return self::ACCESS_UNDEFINED;
                    }
                }
                try {
                    if(AclProxy::hasAccess($user, $resolvedAction['controller'], $resolvedAction['action'], $node)){
                        return self::ACCESS_GRANTED;
                    }
                    return self::ACCESS_DENIED;
                } catch(\Exception $e){

                    \common_Logger::w('Unable to resolve permission for action ' . $action->getId() . ' : ' . $e->getMessage() );
                }
            }
        }
        return self::ACCESS_UNDEFINED;
    }
public function hasAccess(MenuAction $action, common_user_User $user, array $node){

        $resolvedAction = $this->getResolvedAction($action);
        if(!is_null($resolvedAction) && !is_null($user)){
            if($node['type'] = $resolvedAction['context'] || $resolvedAction['context'] == 'resource') {
                foreach($resolvedAction['required'] as $key){
                    if(!array_key_exists($key, $node)){
                        //missing required key
                        return self::ACCESS_UNDEFINED;
                    }
                }
                try {
                    if(AclProxy::hasAccess($user, $resolvedAction['controller'], $resolvedAction['action'], $node)){
                        return self::ACCESS_GRANTED;
                    }
                    return self::ACCESS_DENIED;
                } catch(\Exception $e){

                    \common_Logger::w('Unable to resolve permission for action ' . $action->getId() . ' : ' . $e->getMessage() );
                }
            }
        }
        return self::ACCESS_UNDEFINED;
    }
public function hasAccess ( MenuAction $ action , common_user_User $ user , array $ node ) { $ resolvedAction = $ this -> getResolvedAction ( $ action ) ; if ( ! is_null ( $ resolvedAction ) && ! is_null ( $ user ) ) { if ( $ node [ 'type' ] = $ resolvedAction [ 'context' ] || $ resolvedAction [ 'context' ] == 'resource' ) { foreach ( $ resolvedAction [ 'required' ] as $ key ) { if ( ! array_key_exists ( $ key , $ node ) ) { //missing required key return self :: ACCESS_UNDEFINED ; } } try { if ( AclProxy :: hasAccess ( $ user , $ resolvedAction [ 'controller' ] , $ resolvedAction [ 'action' ] , $ node ) ) { return self :: ACCESS_GRANTED ; } return self :: ACCESS_DENIED ; } catch ( \ Exception $ e ) { \ common_Logger :: w ( 'Unable to resolve permission for action ' . $ action -> getId ( ) . ' : ' . $ e -> getMessage ( ) ) ; } } } return self :: ACCESS_UNDEFINED ; }
Has a node access to an action
@param MenuAction        $action the menu action
@param common_user_User  $user   the user to check
@param array             $node   the node/resource to verify
@return int                      the access level
Has a node access to an action