original_string: public function isGranted(string $action): bool
      {
          if (empty($this->allowed)) {
              return false;
          }
  
          if (isset($this->denied[$action]) || isset($this->denied[self::WILDCARD])) {
              return false;
          }
  
          $rules = $this->getRules($action);
  
          foreach ($rules as $rule) {
              if (isset($this->denied[$rule])) {
                  return false;
              }
          }
  
          foreach ($rules as $rule) {
              if (isset($this->allowed[$rule])) {
                  return true;
              }
          }
  
          return false;
      }
code: public function isGranted(string $action): bool
      {
          if (empty($this->allowed)) {
              return false;
          }
  
          if (isset($this->denied[$action]) || isset($this->denied[self::WILDCARD])) {
              return false;
          }
  
          $rules = $this->getRules($action);
  
          foreach ($rules as $rule) {
              if (isset($this->denied[$rule])) {
                  return false;
              }
          }
  
          foreach ($rules as $rule) {
              if (isset($this->allowed[$rule])) {
                  return true;
              }
          }
  
          return false;
      }
code_tokens: public function isGranted ( string $ action ) : bool { if ( empty ( $ this -> allowed ) ) { return false ; } if ( isset ( $ this -> denied [ $ action ] ) || isset ( $ this -> denied [ self :: WILDCARD ] ) ) { return false ; } $ rules = $ this -> getRules ( $ action ) ; foreach ( $ rules as $ rule ) { if ( isset ( $ this -> denied [ $ rule ] ) ) { return false ; } } foreach ( $ rules as $ rule ) { if ( isset ( $ this -> allowed [ $ rule ] ) ) { return true ; } } return false ; }
docstring: Returns true if the policy should allow the action
  to be carried out.
  
  @param string $action
  
  @return bool
docstring_tokens: Returns true if the policy should allow the action to be carried out .