classes/ezcompermission.php
public function hasFunctionAccess( $user, $functionName, $contentObject, $languageCode, $comment = null, $scope = null, $node = null )
    {
        $result = $user->hasAccessTo( self::$moduleName, $functionName );

        if ( $result['accessWord'] !== 'limited' )
        {
            $return = ( $result['accessWord'] === 'yes' ) and ( $scope !== 'personal' );
        }
        else
        {
            foreach( $result['policies'] as $limitationArray )
            {
                // eZDebug::writeDebug( $limitationArray, "limitationArray for function $functionName" );

                $return = true;
                foreach( $limitationArray as $limitationKey => $limitation )
                {
                    // deal with limitation checking
                    $resultItem = $this->checkPermission( $user, $limitationKey, $limitation,
                        $contentObject, $languageCode, $comment, $scope, $node );
                    ezDebugSetting::writeNotice( 'extension-ezcomments',
                        "Permission check result for function '$functionName' with limitation '$limitationKey': " . ( $resultItem === true ? 'true' : 'false' ), __METHOD__ );
                    $return = ( $return and $resultItem );
                }

                if ( $return === true )
                    break;
            }
        }
        return $return;
    }
public function hasFunctionAccess( $user, $functionName, $contentObject, $languageCode, $comment = null, $scope = null, $node = null )
    {
        $result = $user->hasAccessTo( self::$moduleName, $functionName );

        if ( $result['accessWord'] !== 'limited' )
        {
            $return = ( $result['accessWord'] === 'yes' ) and ( $scope !== 'personal' );
        }
        else
        {
            foreach( $result['policies'] as $limitationArray )
            {
                // eZDebug::writeDebug( $limitationArray, "limitationArray for function $functionName" );

                $return = true;
                foreach( $limitationArray as $limitationKey => $limitation )
                {
                    // deal with limitation checking
                    $resultItem = $this->checkPermission( $user, $limitationKey, $limitation,
                        $contentObject, $languageCode, $comment, $scope, $node );
                    ezDebugSetting::writeNotice( 'extension-ezcomments',
                        "Permission check result for function '$functionName' with limitation '$limitationKey': " . ( $resultItem === true ? 'true' : 'false' ), __METHOD__ );
                    $return = ( $return and $resultItem );
                }

                if ( $return === true )
                    break;
            }
        }
        return $return;
    }
public function hasFunctionAccess ( $ user , $ functionName , $ contentObject , $ languageCode , $ comment = null , $ scope = null , $ node = null ) { $ result = $ user -> hasAccessTo ( self :: $ moduleName , $ functionName ) ; if ( $ result [ 'accessWord' ] !== 'limited' ) { $ return = ( $ result [ 'accessWord' ] === 'yes' ) and ( $ scope !== 'personal' ) ; } else { foreach ( $ result [ 'policies' ] as $ limitationArray ) { // eZDebug::writeDebug( $limitationArray, "limitationArray for function $functionName" ); $ return = true ; foreach ( $ limitationArray as $ limitationKey => $ limitation ) { // deal with limitation checking $ resultItem = $ this -> checkPermission ( $ user , $ limitationKey , $ limitation , $ contentObject , $ languageCode , $ comment , $ scope , $ node ) ; ezDebugSetting :: writeNotice ( 'extension-ezcomments' , "Permission check result for function '$functionName' with limitation '$limitationKey': " . ( $ resultItem === true ? 'true' : 'false' ) , __METHOD__ ) ; $ return = ( $ return and $ resultItem ) ; } if ( $ return === true ) break ; } } return $ return ; }
check if the user has Acceess to the object with limitation of class, section, owner, language, nodes, subtrees

return true if has, false if not
check if the user has Acceess to the object with limitation of class section owner language nodes subtrees