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. 

```
{
    assert(roles_info_);
    roles_info = roles_info_;
    enabled_row_policies = access_control->getEnabledRowPolicies(
        *params.user_id, roles_info->enabled_roles);
    enabled_quota = access_control->getEnabledQuota(
        *params.user_id, user_name, roles_info->enabled_roles, params.address, params.forwarded_address, params.quota_key);
    enabled_settings = access_control->getEnabledSettings(
        *params.user_id, user->settings, roles_info->enabled_roles, roles_info->settings_from_enabled_roles);
    calculateAccessRights();
}
void ContextAccess::calculateAccessRights() const
{
    access = std::make_shared<AccessRights>(mixAccessRightsFromUserAndRoles(*user, *roles_info));
    access_with_implicit = std::make_shared<AccessRights>(addImplicitAccessRights(*access));
    if (trace_log)
    {
        if (roles_info && !roles_info->getCurrentRolesNames().empty())
        {
            LOG_TRACE(trace_log, "Current_roles: {}, enabled_roles: {}",
                boost::algorithm::join(roles_info->getCurrentRolesNames(), ", "),
                boost::algorithm::join(roles_info->getEnabledRolesNames(), ", "));
        }
        LOG_TRACE(trace_log, "Settings: readonly={}, allow_ddl={}, allow_introspection_functions={}", params.readonly, params.allow_ddl, params.allow_introspection);
        LOG_TRACE(trace_log, "List of all grants: {}", access->toString());
        LOG_TRACE(trace_log, "List of all grants including implicit: {}", access_with_implicit->toString());
    }
}
UserPtr ContextAccess::getUser() const