addAclPermission example

$this->View()->assign('success', true);
    }

    public function detailAction(string $id): void
    {
        $this->View()->assign('success', true);
        $this->View()->assign('data', $this->getDetail($id));
    }

    protected function initAcl(): void
    {
        $this->addAclPermission('index', 'read', 'Insufficient permissions');
        $this->addAclPermission('load', 'read', 'Insufficient permissions');
        $this->addAclPermission('list', 'read', 'Insufficient permissions');
        $this->addAclPermission('detail', 'read', 'Insufficient permissions');
        $this->addAclPermission('create', 'edit', 'Insufficient permissions');
        $this->addAclPermission('update', 'edit', 'Insufficient permissions');
        $this->addAclPermission('delete', 'delete', 'Insufficient permissions');
    }

    /** * @return array<string, mixed> */
    

    }

    /** * Registers the different acl permission for the different controller actions. */
    protected function initAcl()
    {
        /* * Permission to create a Group */
        $this->addAclPermission('createGroup', 'createGroup', 'Insufficient Permissions');

        /* * Permission to delete a site */
        $this->addAclPermission('deleteSite', 'deleteSite', 'Insufficient Permissions');

        /* * Permission to delete a group */
        $this->addAclPermission('deleteGroup', 'deleteGroup', 'Insufficient Permissions');

        

    protected function initAcl()
    {
        $namespace = Shopware()->Snippets()->getNamespace('backend/shipping/controller');
        // Read         $this->addAclPermission('getCostsMatrixAction', 'read', $namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('getCountriesAction', 'read', $namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('getHolidaysAction', 'read', $namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('getPaymentsAction', 'read', $namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('getShippingCostsAction', 'read', $namespace->get('no_list_rights', 'Read access denied.'));
        // Update         $this->addAclPermission('updateCostsMatrixAction', 'update', $namespace->get('no_update_rights', 'Update access denied.'));
        $this->addAclPermission('updateDispatchAction', 'update', $namespace->get('no_update_rights', 'Update access denied.'));
        // Delete         $this->addAclPermission('deleteAction', 'delete', $namespace->get('no_delete_rights', 'Delete access denied.'));
        $this->addAclPermission('deleteCostsMatrixEntryAction', 'delete', $namespace->get('no_delete_rights', 'Delete access denied.'));
        // Create
/** * Method to define acl dependencies in backend controllers * <code> * $this->addAclPermission("name_of_action_with_action_prefix","name_of_assigned_privilege","optionally error message"); * // $this->addAclPermission("indexAction","read","Ops. You have no permission to view that..."); * </code> */
    protected function initAcl()
    {
        // Read         $this->addAclPermission('getList', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getDetail', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getPathByQuery', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getIdPath', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getTemplateSettings', 'read', 'Insufficient Permissions');

        // Update         $this->addAclPermission('updateDetail', 'update', 'Insufficient Permissions');

        // Delete         $this->addAclPermission('delete', 'delete', 'Insufficient Permissions');

        
/** * Method to define acl dependencies in backend controllers * <code> * $this->addAclPermission("name_of_action_with_action_prefix","name_of_assigned_privilege","optionally error message"); * // $this->addAclPermission("indexAction","read","Ops. You have no permission to view that..."); * </code> */
    protected function initAcl()
    {
        $this->namespace = Shopware()->Snippets()->getNamespace('backend/banner/banner');
        $this->addAclPermission('getAllBannersAction', 'read', $this->namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('getListAction', 'read', $this->namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('getBannerAction', 'read', $this->namespace->get('no_list_rights', 'Read access denied.'));
        $this->addAclPermission('deleteBannerAction', 'delete', $this->namespace->get('no_delete_rights', 'Delete access denied.'));
        $this->addAclPermission('updateBannerAction', 'update', $this->namespace->get('no_update_rights', 'Update access denied.'));
        $this->addAclPermission('createBannerAction', 'create', $this->namespace->get('no_create_rights', 'Create access denied.'));
    }

    /** * Build an array and re-formats the date for a banner. * If the second parameter is set true, every banner will be tracked. * * @param array $banners * * @return array|null */
$this->View()->assign(
            $this->getTemplates(
                $this->Request()->getParam('start'),
                $this->Request()->getParam('limit'),
                $this->Request()->getParam('id')
            )
        );
    }

    protected function initAcl()
    {
        $this->addAclPermission('list', 'read', 'Insufficient permissions');
        $this->addAclPermission('detail', 'read', 'Insufficient permissions');
        $this->addAclPermission('library', 'read', 'Insufficient permissions');
        $this->addAclPermission('fill', 'read', 'Insufficient permissions');

        $this->addAclPermission('delete', 'delete', 'Insufficient permissions');

        $this->addAclPermission('save', 'save', 'Insufficient permissions');
        $this->addAclPermission('updateStatusAndPosition', 'save', 'Insufficient permissions');
        $this->addAclPermission('upload', 'save', 'Insufficient permissions');
        $this->addAclPermission('import', 'save', 'Insufficient permissions');
        $this->addAclPermission('afterImport', 'save', 'Insufficient permissions');

        
default:
                break;
        }
    }

    /** * {@inheritdoc} */
    protected function initAcl()
    {
        // read         $this->addAclPermission('getInfo', 'read', 'Insufficient Permissions');
        // update         $this->addAclPermission('config', 'update', 'Insufficient Permissions');
        // clear         $this->addAclPermission('clearCache', 'clear', 'Insufficient Permissions');
        $this->addAclPermission('clearDirect', 'clear', 'Insufficient Permissions');
    }
}

    public function preDispatch()
    {
        if (!\in_array($this->Request()->getActionName()['index', 'load'])) {
            $this->Front()->Plugins()->Json()->setRenderer(true);
        }
    }

    public function initAcl()
    {
        $this->addAclPermission('getPayments', 'read', "You're not allowed to see the payments.");
        $this->addAclPermission('createPayments', 'create', "You're not allowed to create a payment.");
        $this->addAclPermission('updatePayments', 'update', "You're not allowed to update the payment.");
        $this->addAclPermission('deletePayment', 'delete', "You're not allowed to delete the payment.");
    }

    /** * Main-Method to get all payments and its countries and subshops * The data is additionally formatted, so additional-information are also given */
    public function getPaymentsAction()
    {
        
return $collection;
    }

    /** * Registers the different acl permission for the different controller actions. */
    protected function initAcl()
    {
        /* * Permission to list all feeds */
        $this->addAclPermission('getFeedsAction', 'read', 'Insufficient Permissions');

        /* * Permission to show detail information of a feed */
        $this->addAclPermission('getDetailFeedAction', 'read', 'Insufficient Permissions');

        /* * Permission to delete the feed */
        $this->addAclPermission('deleteFeedAction', 'delete', 'Insufficient Permissions');
    }

    
'success' => true,
            'data' => $orders,
            'total' => \count($orders),
        ]);
    }

    /** * Method to define acl dependencies in backend controllers */
    protected function initAcl()
    {
        $this->addAclPermission('getOrderSummary', 'read');
    }
}
use Shopware\Components\Log\Parser\LogfileParser;
use Shopware\Models\Log\Log;
use Symfony\Component\Finder\Finder;

class Shopware_Controllers_Backend_Log extends Shopware_Controllers_Backend_ExtJs implements CSRFWhitelistAware
{
    /** * Sets the ACL-rights for the log-module */
    public function initAcl()
    {
        $this->addAclPermission('getLogs', 'read', 'You\'re not allowed to see the logs.');
        $this->addAclPermission('deleteLogs', 'delete', 'You\'re not allowed to delete the logs.');
        $this->addAclPermission('downloadLogFile', 'system', 'You\'re not allowed to see the system logs.');
        $this->addAclPermission('getLogFileList', 'system', 'You\'re not allowed to see the system logs.');
        $this->addAclPermission('getLogList', 'system', 'You\'re not allowed to see the system logs.');
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        


        $this->View()->assign('data', $result);
        $this->View()->assign('success', true);
    }

    /** * Method to define acl dependencies in backend controllers */
    protected function initAcl()
    {
        $this->addAclPermission('index', 'update');

        $this->addAclPermission('index', 'read');
        $this->addAclPermission('getMails', 'read');
        $this->addAclPermission('createMail', 'create');
        $this->addAclPermission('removeMail', 'delete');
        $this->addAclPermission('updateMail', 'update');
        $this->addAclPermission('copyMail', 'create');

        $this->addAclPermission('getAttachments', 'read');
        $this->addAclPermission('addAttachment', 'update');
        $this->addAclPermission('removeAttachment', 'update');
        
'data' => $result->getData(),
            'totalCount' => $result->getTotalCount(),
        ]);
    }

    /** * @return void */
    protected function initAcl()
    {
        // read         $this->addAclPermission('shopList', 'read', 'Insufficient Permissions');
        $this->addAclPermission('sourceList', 'read', 'Insufficient Permissions');
        $this->addAclPermission('orderAnalytics', 'read', 'Insufficient Permissions');
        $this->addAclPermission('visits', 'read', 'Insufficient Permissions');
        $this->addAclPermission('orderDetailAnalytics', 'read', 'Insufficient Permissions');
        $this->addAclPermission('searchAnalytics', 'read', 'Insufficient Permissions');
        $this->addAclPermission('conversionRate', 'read', 'Insufficient Permissions');
    }

    /** * @deprecated - Will be private in Shopware 5.8 * * @param array<array<string, string|int|float>> $data * @param int $totalCount * * @return void */

    public function loadAmountPerStreamChartAction()
    {
        $chart = $this->container->get(CustomerStreamRepositoryInterface::class)
            ->fetchAmountPerStreamChart();

        $this->View()->assign('data', array_values($chart));
    }

    protected function initAcl()
    {
        $this->addAclPermission('read', 'list', 'You do not have sufficient rights to delete a customer.');
        $this->addAclPermission('read', 'detail', 'You do not have sufficient rights to delete a customer.');
        $this->addAclPermission('delete', 'delete', 'You do not have sufficient rights to delete a customer.');
        $this->addAclPermission('update', 'save', 'You do not have sufficient rights to update a customer.');
        $this->addAclPermission('create', 'save', 'You do not have sufficient rights to create a customer.');
        $this->addAclPermission('indexStream', 'save', 'You do not have sufficient rights to index Customer Streams.');
        $this->addAclPermission('buildSearchIndex', 'search_index', 'You do not have sufficient rights to index customer search.');
        $this->addAclPermission('loadChart', 'charts', 'You do not have sufficient rights to load this data.');
        $this->addAclPermission('loadAmountPerStreamChart', 'charts', 'You do not have sufficient rights to load this data.');
    }

    protected function getList($offset$limit$sort = []$filter = [], array $wholeParams = [])
    {
/** * Method to define acl dependencies in backend controllers * * <code> * $this->addAclPermission("name_of_action_with_action_prefix","name_of_assigned_privilege","optionally error message"); * // $this->addAclPermission("indexAction","read","Ops. You have no permission to view that..."); * </code> */
    protected function initAcl()
    {
        // Read         $this->addAclPermission('getStatistics', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getArticle', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getBasket', 'read', 'Insufficient Permissions');
        $this->addAclPermission('getOrder', 'read', 'Insufficient Permissions');

        // Delete         $this->addAclPermission('deleteOrder', 'delete', 'Insufficient Permissions');
    }

    /** * Read free codes from the database. If no free codes are available, null will be returned * * @return array<string, mixed>|null */
Home | Imprint | This part of the site doesn't use cookies.