code: protected function match($role, $action): bool {
          $roles = $actions = ['*'];
  
          $allow = false;
  
          if ($role != '*')
              array_unshift($roles, $role);
          if ($action != '*')
              array_unshift($actions, $action);
  
          // Ищем наиболее подходящее правило. Идем от частного к общему.
          foreach ($roles as $_role) {
              foreach ($actions as $_action) {
                  if (isset($this->_rules[$_role][$_action])) {
                      $allow = $this->_rules[$_role][$_action];
                      break 2;
                  }
              }
          }
  
          return $allow === true;
      }
docs: Check if a role is allowed to an action.
  
  @param $role
  @param $action
  @return bool