prodigious / sonata-permission-bundle
This bundle provides a friendly view to display roles administration.
Installs: 74
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.0.0
- doctrine/doctrine-bundle: ~1.3
- sonata-project/admin-bundle: ^3.35
- sonata-project/user-bundle: ^4.2
- symfony/symfony: ^3.0
This package is auto-updated.
Last update: 2024-10-12 04:29:59 UTC
README
This bundle provides a friendly view to display roles administration.
Prerequisites
- SonataAdminBundle
- SonataUserBundle
Screenshots
Installation
composer require prodigious/sonata-permission-bundle
Configuration
// app/AppKernel.php
new Prodigious\Sonata\PermissionBundle\ProdigiousSonataPermissionBundle(),
config.yml
sonata_admin:
security:
handler: sonata.admin.security.handler.role
twig:
form_themes:
- '@ProdigiousSonataPermission/Form/prodigious_sonata_security_roles_widget.html.twig'
sonata_acl.yml
Configuration:
There are two types of view for items:
- Type role: display all permission in a list of checkbox, the parameter 'name' should be a role.
- Type entity: display all permission in a table with the permissions you have difine, the parameter 'name' should be a service admin of sonata, by defaut, the parameter permissions are { 'Create': 'CREATE', 'Edit': 'EDIT', 'List': 'LIST', 'View': 'VIEW', 'Delete': 'DELETE', 'Export': 'EXPORT' }
Configuration example
prodigious_sonata_permission:
default_roles: []
auto_replace_roles_field: true
groups:
admin:
label: Admin Roles
translation_domain: ProdigiousSonataPermissionBundle
multiple_choice: false # radio
items:
- { type: role, name: ROLE_SUPER_ADMIN, label: ROLE_SUPER_ADMIN }
- { type: role, name: ROLE_ADMIN, label: ROLE_ADMIN }
content:
label: Content
translation_domain: ProdigiousSonataPermissionBundle
multiple_choice: true # checkbox
items:
- { type: entity, name: sonata.admin.news }
- { type: entity, name: sonata.admin.product, permissions: { 'Edit': 'EDIT', 'Delete': 'DELETE' } } // permissions est optionnal
classification:
label: Classification
translation_domain: ProdigiousSonataPermissionBundle
items:
- { type: entity, name: sonata.admin.category }
- { type: entity, name: sonata.admin.tag }
media:
label: Media
translation_domain: ProdigiousSonataPermissionBundle
items:
- { type: entity, name: sonata.media.admin.media }
- { type: entity, name: sonata.media.admin.gallery }
user:
label: User
translation_domain: ProdigiousSonataPermissionBundle
items:
- { type: entity, name: sonata.user.admin.user }
- { type: entity, name: sonata.user.admin.group }
Changelog
Additional info
Author: Nan GUO
Company : Prodigious