2017 © Pedro Peláez
 

library eav-permission-bundle

Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle

image

sidus/eav-permission-bundle

Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle

  • Thursday, March 22, 2018
  • by VincentChalnot
  • Repository
  • 1 Watchers
  • 0 Stars
  • 340 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 81 % Grown

The README.md

Sidus/EAVPermissionBundle Documentation

This bundle allows you to define role-based permissions for the Sidus/EAVModelBundle., (*1)

It supports permissions on families, attributes and EAVData through their families. (So no entity-level permissions), (*2)

Quick example

Roles are just meant as an example, there is no hard-coded role in this bundle., (*3)

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: true

                content:
                    type: html

                publicationDate:
                    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:, (*4)

<?php

use Sidus\EAVModelBundle\Model\FamilyInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Sidus\EAVPermissionBundle\Security\Permission;

/** @var FamilyInterface $family */
/** @var AuthorizationCheckerInterface $securityChecker **/
$securityChecker->isGranted(Permission::EDIT, $family);
Note
If you are using the 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., (*5)

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, (*6)

The Versions

22/03 2018

dev-master

9999999-dev https://github.com/VincentChalnot/SidusEAVPermissionBundle

Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle

  Sources   Download

MIT

The Requires

 

roles permissions eav

22/03 2018

v0.2

0.2.0.0 https://github.com/VincentChalnot/SidusEAVPermissionBundle

Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle

  Sources   Download

MIT

The Requires

 

roles permissions eav

21/03 2018

v0.1

0.1.0.0 https://github.com/VincentChalnot/SidusEAVPermissionBundle

Integrates attribute-level permissions based on roles for the Sidus/EAVModelBundle

  Sources   Download

MIT

The Requires

 

roles permissions eav