From 281256e17c065aa89286af3fafa80550e9fbf5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D0=BE=D1=80=D0=B3=D0=B8=D0=B9=20=D0=9F=D1=80?= =?UTF-8?q?=D0=BE=D0=BD=D1=8E=D0=BA?= <56407064+gepron1x@users.noreply.github.com> Date: Mon, 28 Mar 2022 22:22:37 +0300 Subject: [PATCH] Grant all necessary permissions to generated SQL users (#3800) * grant all necessary permissions to users * fix CREATE TEMPORARY TABLES Co-authored-by: A248 Co-authored-by: A248 Co-authored-by: Matthew Penner --- app/Repositories/Eloquent/DatabaseRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Eloquent/DatabaseRepository.php b/app/Repositories/Eloquent/DatabaseRepository.php index c42cb91b2..53e590df9 100644 --- a/app/Repositories/Eloquent/DatabaseRepository.php +++ b/app/Repositories/Eloquent/DatabaseRepository.php @@ -107,7 +107,7 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor public function assignUserToDatabase(string $database, string $username, string $remote): bool { return $this->run(sprintf( - 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, REFERENCES, INDEX, LOCK TABLES, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON `%s`.* TO `%s`@`%s`', + 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, REFERENCES, INDEX, LOCK TABLES, CREATE ROUTINE, ALTER ROUTINE, EXECUTE, CREATE TEMPORARY TABLES, CREATE VIEW, SHOW VIEW, EVENT, TRIGGER ON `%s`.* TO `%s`@`%s`', $database, $username, $remote