Skip to content

Commit 2bb4cdc

Browse files
[TEST III]
1 parent a276634 commit 2bb4cdc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/charms/mysql/v0/mysql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,11 @@ def configure_mysql_router_roles(self) -> None:
11311131
f"CREATE ROLE {role}",
11321132
f"GRANT CREATE ON *.* TO {role}",
11331133
f"GRANT CREATE USER ON *.* TO {role}",
1134-
f"GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON *.* TO {role} WITH GRANT OPTION",
1134+
# The granting of all privileges to the MySQL Router role
1135+
# can only be restricted when the privileges to the users
1136+
# created by such role are restricted as well
1137+
# https://github.com/canonical/mysql-router-operator/blob/main/src/mysql_shell/__init__.py#L134-L136
1138+
f"GRANT ALL ON *.* TO {role} WITH GRANT OPTION",
11351139
]
11361140

11371141
try:

tests/unit/test_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_configure_mysql_router_roles(self, _run_mysqlcli_script, _list_mysql_ro
149149
f"CREATE ROLE {role}",
150150
f"GRANT CREATE ON *.* TO {role}",
151151
f"GRANT CREATE USER ON *.* TO {role}",
152-
f"GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON *.* TO {role} WITH GRANT OPTION",
152+
f"GRANT ALL ON *.* TO {role} WITH GRANT OPTION",
153153
]
154154

155155
self.mysql.configure_mysql_router_roles()

0 commit comments

Comments
 (0)