craftcamp/abac-bundle
Symfony bundle integrating CraftCamp’s PHP ABAC library for attribute-based access control. Define policy rules based on user and resource attributes (roles as attributes too) and enforce permissions via a security service that can return denied attributes for debugging.
age, vehicle.origin, service_status) instead of static role assignments.rejected_attributes) for denied requests, improving debugging and compliance.policy_rules.yml) for easy updates without code changes, reducing technical debt.parentNationality or manufactureDate.php-abac) with Symfony-specific optimizations (e.g., caching, autowiring).ADMIN, USER). Use Symfony’s built-in SecurityBundle instead.lastTechnicalReviewDate), location (vehicle.origin), or external services (SERVICE_STATUS).*"This package lets us replace rigid ‘role-based’ permissions with smart, attribute-driven access control—like a firewall that adapts to real-world conditions. For example, instead of giving everyone a ‘Manager’ role, we can define rules like:
*"The CraftCamp ABAC Bundle wraps the PHP ABAC library into Symfony, giving us:
policy_rules.yml) instead of scattering if checks in controllers.%kernel.cache_dir%/abac).rejected_attributes: ['hasDrivingLicense']) for denied requests.CacheManager, AttributeManager) for custom logic.
Use case: Replace isGranted('ROLE_ADMIN') with abac->enforce('admin_rule', $user, $resource) for fine-grained, maintainable access control."**"ABAC shifts access control from static roles to dynamic attributes, making it easier to:
parentNationality did not match’).isCompliantWithGDPR to existing rules).
This reduces shadow IT and aligns permissions with real-world context."*How can I help you explore Laravel packages today?