From 1abe8f8bfc39d882dd5549407e7d916ace934b7f Mon Sep 17 00:00:00 2001 From: niko4299 Date: Thu, 7 Jul 2022 13:15:01 +0200 Subject: [PATCH] Labels defined with colon --- src/memgraph.cpp | 2 +- src/query/frontend/opencypher/grammar/MemgraphCypher.g4 | 2 +- src/query/interpreter.cpp | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/memgraph.cpp b/src/memgraph.cpp index 955379024..e935c03ec 100644 --- a/src/memgraph.cpp +++ b/src/memgraph.cpp @@ -501,7 +501,7 @@ class AuthQueryHandler final : public memgraph::query::AuthQueryHandler { if (first_user) { spdlog::info("{} is first created user. Granting all privileges.", username); - GrantPrivilege(username, memgraph::query::kPrivilegesAll, {}); + GrantPrivilege(username, memgraph::query::kPrivilegesAll, {"*"}); } return user_added; diff --git a/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 b/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 index 12d54a916..cb9cc2ba0 100644 --- a/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 +++ b/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 @@ -260,7 +260,7 @@ privilege : CREATE privilegeList : privilege ( ',' privilege )* ; -labelList : label ( ',' label )* ; +labelList : COLON label ( ',' COLON label )* ; label : ( '*' | symbolicName ) ; diff --git a/src/query/interpreter.cpp b/src/query/interpreter.cpp index f07d6e414..ec2eed347 100644 --- a/src/query/interpreter.cpp +++ b/src/query/interpreter.cpp @@ -295,10 +295,11 @@ Callback HandleAuthQuery(AuthQuery *auth_query, AuthQueryHandler *auth, const Pa AuthQuery::Action::REVOKE_PRIVILEGE, AuthQuery::Action::SHOW_PRIVILEGES, AuthQuery::Action::SHOW_USERS_FOR_ROLE, AuthQuery::Action::SHOW_ROLE_FOR_USER}; - if (license_check_result.HasError() && enterprise_only_methods.contains(auth_query->action_)) { - throw utils::BasicException( - utils::license::LicenseCheckErrorToString(license_check_result.GetError(), "advanced authentication features")); - } + // if (license_check_result.HasError() && enterprise_only_methods.contains(auth_query->action_)) { + // throw utils::BasicException( + // utils::license::LicenseCheckErrorToString(license_check_result.GetError(), "advanced authentication + // features")); + // } switch (auth_query->action_) { case AuthQuery::Action::CREATE_USER: