refactor(program): move item types out of Settings > Configuration

Relocate the item type lists (insights, allocations, objectives, tasks,
stakeholders, audience values) from the Configuration tab to a dedicated
"Item types" page under Programs, served by ItemTypesController at
/program-item-types and guarded by the new program:itemtypes:view
permission. The Program settings tab in Configuration now only holds the
general settings (currency, stakeholder phone region, audience attribute
toggles), so ConfigSubscriber no longer needs the item repositories; the
in-use type protection moved to ItemTypeInUseGuard.
This commit is contained in:
Alexandre Gain committed 2026-11-14 09:20:21 +01:00
1 parent 71ff11390b
commit 687d33d30c
14 files changed
+444 -219

No files matched your search

+6 -2
View File
@@ -8,8 +8,10 @@ use Mautic\CoreBundle\Security\Permissions\AbstractPermissions;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Permission keys: program:initiatives:*, program:tasks:* and program:stakeholders:* (view/edit/delete/publish own and
* other, create, full), and program:categories:* (managing the "initiative" category type).
* Permission keys: program:initiatives:*, program:tasks:*, program:stakeholders:* and
* program:audiences:* (view/edit/delete/publish own and other, create, full), program:itemtypes:*
* (the Item types page, Programs > Item types), and program:categories:* (managing the
* "initiative" category type).
*
* Shown under Settings > Roles. Core discovers this class from Security/Permissions/.
*/
@@ -27,6 +29,7 @@ class ProgramPermissions extends AbstractPermissions
$this->addExtendedPermissions('tasks');
$this->addExtendedPermissions('stakeholders');
$this->addExtendedPermissions('audiences');
$this->addStandardPermissions('itemtypes');
}
public function getName(): string
@@ -45,5 +48,6 @@ class ProgramPermissions extends AbstractPermissions
$this->addExtendedFormFields('program', 'tasks', $builder, $data);
$this->addExtendedFormFields('program', 'stakeholders', $builder, $data);
$this->addExtendedFormFields('program', 'audiences', $builder, $data);
$this->addStandardFormFields('program', 'itemtypes', $builder, $data);
}
}