Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/feat-edithtml-role-permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEAT: The "editHtml" permission can now be granted to roles via the role management GUI, instead of only being available to administrators (#452)
1 change: 0 additions & 1 deletion share/server/core/classes/CoreAuthorisationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class CoreAuthorisationHandler
'createObject' => 'edit',
'deleteObject' => 'edit',
'addModify' => 'edit',
'editHtml' => 'edit',
],
'Overview' => [
'getOverviewRotations' => 'view',
Expand Down
8 changes: 8 additions & 0 deletions share/server/core/classes/CorePDOHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ public static function initialize_static()
],

'updates' => [
'1100500' => [
['-perm-add', ['mod' => 'Map', 'act' => 'editHtml', 'obj' => '*']],
],

'1091500' => [
['-perm-change-act', ['mod' => 'ChangePassword', 'old_act' => 'change', 'new_act' => '*']]
],
Expand Down Expand Up @@ -830,6 +834,10 @@ public function createInitialDb()
$this->queryFatal('-perm-add', ['mod' => 'Map', 'act' => 'manage', 'obj' => '*']);
$this->queryFatal('-perm-add', ['mod' => 'Map', 'act' => 'add', 'obj' => '*']);

// Access controll: Edit HTML content of map objects, grantable via the
// role management GUI (CVE-2024-47090)
$this->queryFatal('-perm-add', ['mod' => 'Map', 'act' => 'editHtml', 'obj' => '*']);

$this->queryFatal('-perm-add', ['mod' => 'MainCfg', 'act' => 'edit', 'obj' => '*']);

// Access control: View URLs e.g. in rotation pools
Expand Down
7 changes: 6 additions & 1 deletion share/server/core/classes/ViewManageRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ private function renderPermissions($role_id)
'rotations' => [],
];
foreach ($AUTHORISATION->getAllVisiblePerms() as $perm) {
if ($perm['mod'] == 'Map' && $perm['act'] != 'add' && $perm['act'] != 'manage') {
if (
$perm['mod'] == 'Map'
&& $perm['act'] != 'add'
&& $perm['act'] != 'manage'
&& $perm['act'] != 'editHtml'
) {
$map_name = $perm['obj'];
if (!isset($permissions_by_section['maps'][$map_name])) {
$permissions_by_section['maps'][$map_name] = [];
Expand Down
Loading