original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: check if the user has Acceess to the object with limitation of class section owner language nodes subtrees