clickhouse version: 22.3.6.5

users.yaml :
```
  public_ro:
    password: "test"
    networks:
      ip: '::/0'
    profile: readonly
    quota: default
    allow_databases:
      - database: public
```
exec result: 
```
clickhouse-0-0.clickhouse-headless.default.svc.cluster.local :) create table test(test Uint32) engine=memory();

CREATE TABLE test
(
    `test` Uint32
)
ENGINE = memory

Query id: c976c324-efa1-418d-a6de-b615a9f8947d


0 rows in set. Elapsed: 0.001 sec. 

Received exception from server (version 22.3.6):
Code: 164. DB::Exception: Received from localhost:9000. DB::Exception: public_ro: Cannot execute query in readonly mode. (READONLY)

clickhouse-0-0.clickhouse-headless.default.svc.cluster.local :) create function test as a -> a*2;

CREATE FUNCTION test AS a -> (a * 2)

Query id: b5b59b1c-5209-4de6-b521-9d6b50f5ce33

Ok.

0 rows in set. Elapsed: 0.003 sec. 

clickhouse-0-0.clickhouse-headless.default.svc.cluster.local :) drop function test;

DROP FUNCTION test

Query id: ee5f2061-4ff0-4627-bd3f-c7052406d484

Ok.

0 rows in set. Elapsed: 0.001 sec. 

```
enabled_roles = nullptr;
        roles_info = nullptr;
        enabled_row_policies = nullptr;
        enabled_quota = nullptr;
        enabled_settings = nullptr;
        return;
    }
    user_name = user->getName();
    trace_log = &Poco::Logger::get("ContextAccess (" + user_name + ")");
    std::vector<UUID> current_roles, current_roles_with_admin_option;
    if (params.use_default_roles)
    {
        current_roles = user->granted_roles.findGranted(user->default_roles);
        current_roles_with_admin_option = user->granted_roles.findGrantedWithAdminOption(user->default_roles);
    }
    else
    {
        current_roles = user->granted_roles.findGranted(params.current_roles);
        current_roles_with_admin_option = user->granted_roles.findGrantedWithAdminOption(params.current_roles);
    }
    subscription_for_roles_changes.reset();
    enabled_roles = access_control->getEnabledRoles(current_roles, current_roles_with_admin_option);
    subscription_for_roles_changes = enabled_roles->subscribeForChanges([this](const std::shared_ptr<const EnabledRolesInfo> & roles_info_)
    {
        std::lock_guard lock{mutex};
        setRolesInfo(roles_info_);
    });
    setRolesInfo(enabled_roles->getRolesInfo());
}
void ContextAccess::setRolesInfo(const std::shared_ptr<const EnabledRolesInfo> & roles_info_) const