HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/timetracker.panomity.com/tm.old/DependencyInjection/TaskManagementExtension.php
<?php

/*
 * This file is part of the TaskManagementBundle for Kimai 2.
 * All rights reserved by Kevin Papst (www.kevinpapst.de).
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace KimaiPlugin\TaskManagementBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Yaml\Parser;

final class TaskManagementExtension extends Extension implements PrependExtensionInterface
{
    /**
     * @param array $configs
     * @param ContainerBuilder $container
     * @return void
     * @throws \Exception
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        if ('test' === $container->getParameter('kernel.environment')) {
            return;
        }

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.yaml');
    }

    /**
     * @see https://symfony.com/doc/current/bundles/prepend_extension.html
     * @param ContainerBuilder $container
     * @return void
     * @throws \Exception
     */
    public function prepend(ContainerBuilder $container)
    {
        $yamlParser = new Parser();

        $config = $yamlParser->parseFile(__DIR__ . '/../Resources/config/packages/jms_serializer.yaml');
        $container->prependExtensionConfig('jms_serializer', $config['jms_serializer']);

        $config = $yamlParser->parseFile(__DIR__ . '/../Resources/config/packages/nelmio_api_doc.yaml');
        $container->prependExtensionConfig('nelmio_api_doc', $config['nelmio_api_doc']);

        $container->prependExtensionConfig('kimai', [
            'permissions' => [
                'roles' => [
                    'ROLE_SUPER_ADMIN' => [
                        'task_edit_own',
                        'task_edit_other',
                        'task_delete',
                        'task_start',
                        'task_start_all',
                        'task_details',
                        'task_close',
                        'task_assign',
                        'task_team_view',
                        'task_view',
                    ],
                    'ROLE_ADMIN' => [
                        'task_edit_own',
                        'task_edit_other',
                        'task_delete',
                        'task_start',
                        'task_start_all',
                        'task_details',
                        'task_close',
                        'task_assign',
                        'task_team_view',
                        'task_view',
                    ],
                    'ROLE_TEAMLEAD' => [
                        'task_edit_own',
                        'task_edit_other',
                        'task_start',
                        'task_details',
                        'task_close',
                        'task_assign',
                        'task_team_view',
                        'task_view',
                    ],
                    'ROLE_USER' => [
                        'task_edit_own',
                        'task_start',
                        'task_details',
                        'task_close',
                        'task_assign',
                        'task_team_view',
                        'task_view',
                    ],
                ],
            ],
        ]);
    }
}