Skip to content

Commit

Permalink
Fix remaining duplicate permission issues from #14995
Browse files Browse the repository at this point in the history
  • Loading branch information
HageMaster3108 authored Jul 3, 2024
1 parent 2166958 commit 88b5baa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ protected function addPermissions(): void
{
$db = \Pimcore\Db::get();

$existingKeys = $db->fetchFirstColumn('SELECT ' . $db->quoteIdentifier('key') . ' FROM users_permission_definitions');

foreach (self::USER_PERMISSIONS as $permission) {
if (in_array($permission, $existingKeys)) {
continue;
}

$db->insert('users_permission_definitions', [
$db->quoteIdentifier('key') => $permission,
$db->quoteIdentifier('category') => self::USER_PERMISSIONS_CATEGORY,
Expand Down

0 comments on commit 88b5baa

Please sign in to comment.