original_string: private static function model_permission_check($model, $httpMethod = 'GET')
      {
          $access = true;
          $apiInstance = self::$instance;
  
          if ($apiInstance->authenticator && $apiInstance->authority) {
              $request = $apiInstance->request;
              $member = $apiInstance->authenticator->getOwner($request);
  
              if (!$member instanceof Member) {
                  $member = null;
              }
  
              $access = $apiInstance->authority->checkPermission($model, $member, $httpMethod);
              if (!is_bool($access)) {
                  $access = true;
              }
          }
  
          return $access;
      }
code: private static function model_permission_check($model, $httpMethod = 'GET')
      {
          $access = true;
          $apiInstance = self::$instance;
  
          if ($apiInstance->authenticator && $apiInstance->authority) {
              $request = $apiInstance->request;
              $member = $apiInstance->authenticator->getOwner($request);
  
              if (!$member instanceof Member) {
                  $member = null;
              }
  
              $access = $apiInstance->authority->checkPermission($model, $member, $httpMethod);
              if (!is_bool($access)) {
                  $access = true;
              }
          }
  
          return $access;
      }
code_tokens: private static function model_permission_check ( $ model , $ httpMethod = 'GET' ) { $ access = true ; $ apiInstance = self :: $ instance ; if ( $ apiInstance -> authenticator && $ apiInstance -> authority ) { $ request = $ apiInstance -> request ; $ member = $ apiInstance -> authenticator -> getOwner ( $ request ) ; if ( ! $ member instanceof Member ) { $ member = null ; } $ access = $ apiInstance -> authority -> checkPermission ( $ model , $ member , $ httpMethod ) ; if ( ! is_bool ( $ access ) ) { $ access = true ; } } return $ access ; }
docstring: Checks a Model's permission for the currently
  authenticated user via the Permission Manager dependency.
  
  For permissions to actually be checked, this means the RESTfulAPI
  must have both authenticator and authority dependencies defined.
  
  If the authenticator component does not return an instance of the Member
  null will be passed to the authority component.
  
  This default to true.
  
  @param  string|DataObject   $model      Model's classname or DataObject to check permission for
  @param  string              $httpMethod API request HTTP method
  @return boolean                         true if access is granted, false otherwise
docstring_tokens: Checks a Model s permission for the currently authenticated user via the Permission Manager dependency .