Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1.38 KB

admins.rst

File metadata and controls

45 lines (27 loc) · 1.38 KB
.. rst-class:: outdated

!DANGER!

This is an outdated documentation please read the new Monofony documentation instead.

.. index::
    single: AdminUser

AdminUser

The AdminUser entity extends the User entity. It is created to enable administrator accounts that have access to the administration panel.

How to create an AdminUser programmatically?

The AdminUser is created just like every other entity, it has its own factory. By default it will have an administration role assigned.

/** @var AdminUserInterface $admin */
$admin = $this->container->get('sylius.factory.admin_user')->createNew();

$admin->setEmail('administrator@test.com');
$admin->setPlainPassword('pswd');

$this->container->get('sylius.repository.admin_user')->add($admin);

Administration Security

In Monofony by default you have got the administration panel routes (/admin/*) secured by a firewall - its configuration can be found in the config/packages/security.yaml file.

Only the logged in AdminUsers are eligible to enter these routes.

Learn more

Note

To learn more, read the UserBundle documentation.