Open a command console, enter your project directory and execute:
$ composer require artox-lab/clarc-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require artox-lab/clarc-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php file of your project:
// config/bundles.php
return [
// ...
ArtoxLab\Bundle\ClarcBundle\ArtoxLabClarcBundle::class => ['all' => true],
];
Configure bundle
# config/packages/artox_lab_clarc.yaml
artox_lab_clarc:
api:
serializer:
class: \ArtoxLab\Bundle\ClarcBundle\Core\Interfaces\UI\API\Transformers\Serializers\NullObjectArraySerializer
security:
rbac:
permissions:
ROLE_MAINTAINER:
- show
get authenticated user permissions API endpointconfig/routes.yamlartox_lab_clarc_bundle_user_permissions:
path: /v1/user/permissions
controller: ArtoxLab\Bundle\ClarcBundle\Core\Interfaces\UI\API\Controllers\PermissionController::permissions
methods: GET
config/packages/security.yamlsecurity:
firewalls:
users:
pattern: ^/v1
...
access_control:
- { path: ^/v1/, roles: IS_AUTHENTICATED_FULLY }
Note: If you have more than one authenticator - do the setup for each one
config/packages/artox_lab_clarc.yamlArtoxLab\Bundle\ClarcBundle\Core\Entity\Security\AuthorizationChecker in your use case / controller$this->authorizationChecker->isGranted('permission_name')# config/packages/artox_lab_clarc.yaml
artox_lab_clarc:
navigation:
left_menu:
show_orphaned_root: false
items:
- icon: portfolio
title: Управление компаниями
children:
- icon: something
link: /companies
title: Компании
permissions: company.list
- link: /companies/add
title: Добавить компанию
permissions: [company.create]
# config/routes.yaml
artox_lab_admin_user_navigations:
path: /user/navigations
controller: ArtoxLab\Bundle\ClarcBundle\Core\Interfaces\UI\API\Controllers\NavigationController::userNavigation
methods: GET
# config/packages/security.yaml
security:
firewalls:
main:
pattern: ^/user
...
access_control:
- { path: ^/user, roles: IS_AUTHENTICATED_FULLY}
GET /user/navigations with authenticationHow can I help you explore Laravel packages today?