Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vincentchalnot/siduseavpermissionbundle
Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle
https://github.com/vincentchalnot/siduseavpermissionbundle
Last synced: 4 days ago
JSON representation
Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle
- Host: GitHub
- URL: https://github.com/vincentchalnot/siduseavpermissionbundle
- Owner: VincentChalnot
- License: mit
- Created: 2018-03-21T11:21:39.000Z (over 6 years ago)
- Default Branch: v1.0-dev
- Last Pushed: 2019-11-19T09:51:30.000Z (almost 5 years ago)
- Last Synced: 2024-08-11T11:05:26.189Z (3 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: Security/Permission.php
Awesome Lists containing this project
README
Sidus/EAVPermissionBundle Documentation
==================================This bundle allows you to define role-based permissions for the Sidus/EAVModelBundle.
It supports permissions on families, attributes and EAVData through their families. (So no entity-level permissions)
## Quick example
Roles are just meant as an example, there is no hard-coded role in this bundle.
````yaml
sidus_eav_model:
families:
Post:
attributeAsLabel: title
options:
permissions:
# list: [] # Don't define a permission: means granted for all
edit: [ROLE_DATA_ADMIN]
delete: [] # Defined but left empty: deny access for all
attributes:
title:
required: truecontent:
type: htmlpublicationDate:
type: datetime
options:
permissions:
read: [ROLE_DATA_MANAGER]
edit: [ROLE_DATA_ADMIN]
````#### Family permissions
There are no rules inside the EAVModelBundle that checks these permissions so it's up to you to check these through
Symfony's security component:
````php
isGranted(Permission::EDIT, $family);
````| Note |
|:-------:|
| If you are using the [EAV Manager](https://github.com/cleverage/eav-manager) these permissions are already checked for in datagrids and actions |#### Attribute permissions
Attribute permissions are supported natively in the EAVModelBundle through the form component.If no permission option is set, it means the attribute will be editable for everyone.
If the attribute is readable but not editable, the form type will appear disabled