| 610 | |
| 611 | |
| 612 | RolePtr parseRole( |
| 613 | const Poco::Util::AbstractConfiguration & config, |
| 614 | const String & role_name, |
| 615 | const std::unordered_set<UUID> & role_ids_from_users_config, |
| 616 | const AccessControl & access_control, |
| 617 | LoggerPtr log) |
| 618 | { |
| 619 | auto role = std::make_shared<Role>(); |
| 620 | role->setName(role_name); |
| 621 | |
| 622 | String role_config = "roles." + role_name; |
| 623 | |
| 624 | const auto grants_config = role_config + ".grants"; |
| 625 | if (config.has(grants_config)) |
| 626 | { |
| 627 | Poco::Util::AbstractConfiguration::Keys keys; |
| 628 | config.keys(grants_config, keys); |
| 629 | for (const auto & key : keys) |
| 630 | { |
| 631 | const auto query = config.getString(grants_config + "." + key); |
| 632 | parseGrant(*role, query, role_ids_from_users_config, access_control, log); |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | return role; |
| 637 | } |
| 638 | |
| 639 | |
| 640 | QuotaPtr parseQuota(const Poco::Util::AbstractConfiguration & config, const String & quota_name, const std::vector<UUID> & user_ids) |
no test coverage detected