PHPackages                             prooph/service-bus-zfc-rbac-bridge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. prooph/service-bus-zfc-rbac-bridge

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

prooph/service-bus-zfc-rbac-bridge
==================================

Marry Service Bus with ZfcRbac

v1.1(10y ago)725.1k6[2 issues](https://github.com/prooph/service-bus-zfc-rbac-bridge/issues)BSD-3-ClausePHPPHP ~5.5|~7.0

Since Sep 13Pushed 7y ago6 watchersCompare

[ Source](https://github.com/prooph/service-bus-zfc-rbac-bridge)[ Packagist](https://packagist.org/packages/prooph/service-bus-zfc-rbac-bridge)[ Docs](http://getprooph.org/)[ RSS](/packages/prooph-service-bus-zfc-rbac-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

service-bus-zfc-rbac-bridge
===========================

[](#service-bus-zfc-rbac-bridge)

Marry Service Bus with ZfcRbac

[![Build Status](https://camo.githubusercontent.com/a7d79d7ba0fb6f4a69c514fb9cc894dd6745343a3f14fc78379673650cc4b746/68747470733a2f2f7472617669732d63692e6f72672f70726f6f70682f736572766963652d6275732d7a66632d726261632d6272696467652e737667)](https://travis-ci.org/prooph/service-bus-zfc-rbac-bridge)[![Coverage Status](https://camo.githubusercontent.com/ae279163b1de5811797ceaffbf234767767c728d255777da1528d3cb68df0658/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f70726f6f70682f736572766963652d6275732d7a66632d726261632d6272696467652f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/prooph/service-bus-zfc-rbac-bridge?branch=master)[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/prooph/improoph)

Important
---------

[](#important)

This library will receive support until December 31, 2019 and will then be deprecated.

For further information see the official announcement here:

Installation
============

[](#installation)

1. Add `"prooph/service-bus-zfc-rbac-bridge": "~1.0"` as requirement to your composer.json.
2. In the `config` folder you will find a [configuration skeleton](config/services.php). The configuration is a simple PHP array flavored with some comments to help you understand the structure.

Requirements
============

[](#requirements)

1. Your Inversion of Control container must implement the [interop-container interface](https://github.com/container-interop/container-interop).
2. ZfcRbac's authorization service should be registered in the container under the `ZfcRbac\Service\AuthorizationService` key.

*Note: Don't worry, if your environment doesn't provide the requirements. You can always bootstrap the authorization service by hand. Just look at the factories for inspiration in this case.*

Sample
======

[](#sample)

Assuming a TestQuery with message name `test` and you want to use the route guard and finalize guard together with an assertion (TestAssertion), your config should look like this:

```
return [
    'prooph' => [
        'service_bus' => [
            'query_bus' => [
                'plugins' => [
                    \Prooph\ServiceBus\RouteGuard::class,
                    \Prooph\ServiceBus\FinalizeGuard::class,
                ]
            ]
        ]
    ],
    'zfc_rbac' => [
        'assertion_manager' => [
            'TestAssertion' => 'TestAssertion',
        ],
        'assertion_map' => [
            'test' => 'TestAssertion'
        ],
        'role_provider' => [
            'ZfcRbac\Role\InMemoryRoleProvider' => [
                'user' => [
                    'permissions' => [
                        'test'
                    ]
                ]
            ]
        ]
    ]
];

```

And your TestAssertion should look like this:

```
class TestAssertion implements \ZfcRbac\Assertion\AssertionInterface
{
    public function assert(AuthorizationService $authorizationService, $context = null)
    {
        // return true, if no context present, otherwise your route guard will always fail, because the result is not yet known.
        if (null === $context) {
            return true;
        }

        return ($context['owner'] == $authorizationService->getIdentity());
    }
}

```

Support
=======

[](#support)

- Ask questions on Stack Overflow tagged with [\#prooph](https://stackoverflow.com/questions/tagged/prooph).
- File issues at .
- Say hello in the [prooph gitter](https://gitter.im/prooph/improoph) chat.

Contribute
==========

[](#contribute)

Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License
-------

[](#license)

Released under the [New BSD License](LICENSE).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Total

2

Last Release

3823d ago

PHP version history (2 changes)v1.0PHP &gt;=5.5

v1.1PHP ~5.5|~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b633be52465d4aa057f04a7dd7ae8e9bb8ad0245c029550252a95eec395f85f4?d=identicon)[prooph](/maintainers/prooph)

---

Top Contributors

[![prolic](https://avatars.githubusercontent.com/u/394428?v=4)](https://github.com/prolic "prolic (20 commits)")

---

Tags

messagingphpproophrbaczend-frameworkrbacmessagingcqrsprooph

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prooph-service-bus-zfc-rbac-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/prooph-service-bus-zfc-rbac-bridge/health.svg)](https://phpackages.com/packages/prooph-service-bus-zfc-rbac-bridge)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[casbin/casbin

a powerful and efficient open-source access control library for php projects.

1.3k1.4M54](/packages/casbin-casbin)[prooph/service-bus

PHP Enterprise Service Bus Implementation supporting CQRS and DDD

4421.4M32](/packages/prooph-service-bus)[prooph/service-bus-symfony-bundle

88392.2k3](/packages/prooph-service-bus-symfony-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
