original_string: public function revokeUserAccess($resource, string $action)
      {
          $resourceRule = $this->getUserPermission($resource);
  
          if (!$resourceRule) {
              return;
          }
  
          // make sure we can work with this
          if ($resourceRule && !($resourceRule instanceof UserPermissionInterface)) {
              throw new PermissionExpectedException(UserPermissionInterface::class, \get_class($resourceRule));
          }
  
          if ($resourceRule) {
              if (!\in_array($action, $resourceRule->getActions(), true)) {
                  return;
              }
              $resourceRule->removeAction($action);
              $this->userPermissions->update($resourceRule);
          }
      }
code: public function revokeUserAccess($resource, string $action)
      {
          $resourceRule = $this->getUserPermission($resource);
  
          if (!$resourceRule) {
              return;
          }
  
          // make sure we can work with this
          if ($resourceRule && !($resourceRule instanceof UserPermissionInterface)) {
              throw new PermissionExpectedException(UserPermissionInterface::class, \get_class($resourceRule));
          }
  
          if ($resourceRule) {
              if (!\in_array($action, $resourceRule->getActions(), true)) {
                  return;
              }
              $resourceRule->removeAction($action);
              $this->userPermissions->update($resourceRule);
          }
      }
code_tokens: public function revokeUserAccess ( $ resource , string $ action ) { $ resourceRule = $ this -> getUserPermission ( $ resource ) ; if ( ! $ resourceRule ) { return ; } // make sure we can work with this if ( $ resourceRule && ! ( $ resourceRule instanceof UserPermissionInterface ) ) { throw new PermissionExpectedException ( UserPermissionInterface :: class , \ get_class ( $ resourceRule ) ) ; } if ( $ resourceRule ) { if ( ! \ in_array ( $ action , $ resourceRule -> getActions ( ) , true ) ) { return ; } $ resourceRule -> removeAction ( $ action ) ; $ this -> userPermissions -> update ( $ resourceRule ) ; } }
docstring: Revoke access to a resource
  
  @param ResourceInterface|string $resource
  @param string                   $action
  
  @throws PermissionExpectedException
  @throws UnknownResourceTypeException
  @throws UserRequiredException
docstring_tokens: Revoke access to a resource