- Implemented TargetType form for managing target details including name, type, priority, stages, estimated size, profile criteria, pain points, value proposition, and preferred channels. - Created migration scripts for adding type and priority columns to plan objectives and tasks. - Added migration for creating plan targets and plan target stages tables, including foreign key constraints. - Introduced stakeholder management with forms and views for creating, editing, and listing stakeholders. - Enhanced UI with read more functionality for long text descriptions and filtering options in plan tab tables.
48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MauticPlugin\PlanBundle\Security\Permissions;
|
|
|
|
use Mautic\CoreBundle\Security\Permissions\AbstractPermissions;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
|
/**
|
|
* Permission keys: plan:plans:*, plan:tasks:* and plan:stakeholders:* (view/edit/delete/publish own and
|
|
* other, create, full), and plan:categories:* (managing the "plan" category type).
|
|
*
|
|
* Shown under Settings > Roles. Core discovers this class from Security/Permissions/.
|
|
*/
|
|
class PlanPermissions extends AbstractPermissions
|
|
{
|
|
/**
|
|
* @param mixed[] $params
|
|
*/
|
|
public function __construct(array $params)
|
|
{
|
|
parent::__construct($params);
|
|
|
|
$this->addStandardPermissions('categories');
|
|
$this->addExtendedPermissions('plans');
|
|
$this->addExtendedPermissions('tasks');
|
|
$this->addExtendedPermissions('stakeholders');
|
|
}
|
|
|
|
public function getName(): string
|
|
{
|
|
return 'plan';
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $options
|
|
* @param array<string, mixed> $data
|
|
*/
|
|
public function buildForm(FormBuilderInterface &$builder, array $options, array $data): void
|
|
{
|
|
$this->addStandardFormFields('plan', 'categories', $builder, $data);
|
|
$this->addExtendedFormFields('plan', 'plans', $builder, $data);
|
|
$this->addExtendedFormFields('plan', 'tasks', $builder, $data);
|
|
$this->addExtendedFormFields('plan', 'stakeholders', $builder, $data);
|
|
}
|
|
}
|