Skip to content

Commit

Permalink
OXDEV-8215: Add separate permissions for listing themes and modules
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelOxid committed Jul 30, 2024
1 parent 78fbcd2 commit 3a3a49e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Module/Controller/ModuleListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
*/
#[Query]
#[Logged]
#[Right('CHANGE_CONFIGURATION')]
#[Right('LIST_MODULES')]
public function modulesList(?ModuleFilters $filters = null): array
{
return $this->moduleListService->getModuleList($filters ?? new ModuleFilters());
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/Controller/ThemeListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
*/
#[Query]
#[Logged]
#[Right('CHANGE_CONFIGURATION')]
#[Right('LIST_THEMES')]
public function themesList(?ThemeFilters $filters): array
{
return $this->themeListService->getThemeList($filters ?? new ThemeFilters());
Expand Down
4 changes: 3 additions & 1 deletion tests/Unit/Shared/Service/PermissionProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public function testGetPermissions(): void
{
$expectedPermissions = [
'oxidadmin' => [
'CHANGE_CONFIGURATION'
'CHANGE_CONFIGURATION',
'LIST_THEMES',
'LIST_MODULES'
],
];

Expand Down

0 comments on commit 3a3a49e

Please sign in to comment.