Skip to content

Commit

Permalink
grantPermission -> grantPermissionForUid
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Aug 21, 2023
1 parent 1178175 commit 6317409
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/php/libAllure/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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'],
]);

Expand Down

0 comments on commit 6317409

Please sign in to comment.