From 631740959e4b5be52b4bf7e4bc68277153e32c0e Mon Sep 17 00:00:00 2001 From: jamesread Date: Mon, 21 Aug 2023 23:30:43 +0100 Subject: [PATCH] grantPermission -> grantPermissionForUid --- src/main/php/libAllure/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/php/libAllure/User.php b/src/main/php/libAllure/User.php index 5bc8cb4..23dd8b8 100644 --- a/src/main/php/libAllure/User.php +++ b/src/main/php/libAllure/User.php @@ -76,7 +76,7 @@ public static function getUser($username) return new User($username); } - private function grantPermission(string $permissionName): bool + private static function grantPermissionToUid(string $permissionName, int $uid): bool { $sql = 'SELECT `id` FROM permissions WHERE `key` = := :permissionName LIMIT 1'; $stmt = DatabaseFactory::getInstance()->prepare($sql); @@ -92,7 +92,7 @@ private function grantPermission(string $permissionName): bool $sql = 'INSERT INTO privileges_u (user, permission) VALUES (:user, :permission)'; $stmt = DatabaseFactory::getInstance()->prepare($sql); $stmt->execute([ - ':user' => $this->getId(), + ':user' => $uid, ':permission' => $permission['id'], ]);