PHPackages                             kinulab/efficient-vote-bundle - 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. kinulab/efficient-vote-bundle

ActiveSymfony-bundle

kinulab/efficient-vote-bundle
=============================

Provide a system to enhance performances of the security by voters

0.2.1(8y ago)21.7kMITPHP

Since Nov 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kinulab/efficient-vote-bundle)[ Packagist](https://packagist.org/packages/kinulab/efficient-vote-bundle)[ RSS](/packages/kinulab-efficient-vote-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (5)Used By (0)

Efficient Vote Bundle
=====================

[](#efficient-vote-bundle)

With Symfony you can install access management either with [ACLs](http://symfony.com/doc/master/security/acl.html)or with [voters](http://symfony.com/doc/master/components/security/authorization.html). ACLs are hard to implements and voters have performances issues. This bundle provides a way to enjoy the simplicity of voters without the drawback of performances.

Backgroup
---------

[](#backgroup)

The performance issue of voters comes from the `AccessDecisionManager` service. His role is to ask every voter to know if the current user is allowed to perform a given action (e.g. `ROLE_SUPER_ADMIN`). The problem is that this service is not aware that most of the voters will abstain as they don't support the attribute.

So, if your application has 10 voters and your template uses 10 times the `is_granted()` function, it makes 100 calls. If your application grows, this will become a bottleneck.

To solve that, this bundle overwrites the default `AccessDecisionManager` service. With the new service, you can register your voters and specify which attributes are supported. The access decision manager will so not call your voter if he's not competent for the attribute.

Installation
------------

[](#installation)

```
composer require kinulab/efficient-vote-bundle

```

Then add in you `app/config/AppKernel.php` :

```
    public function registerBundles()
    {
        $bundles = [
            // [...]
            new Kinulab\EfficientVoteBundle\KinulabEfficientVoteBundle(),
        ];
```

Usage
-----

[](#usage)

The new access decision manager will assume that you organize your voter by types and by domains.

Your must then name your roles with this forms:

```
ROLE _ HOUSE _ OPEN_DOOR
|__|   |___|   |_______|
type   domain  attribute

```

Your voters class remain exaclty like the standards symfony voters. The only difference is on the registration of your voter service.

With a standard vorter, your service is registered like that:

```
# app/config/services.yml
services:
    app.host_voter:
        class: AppBundle\Security\hostVoter
        # small performance boost
        public: false
        tags:
            - { name: security.voter }
```

With this bundle you should now register your service like that :

```
# app/config/services.yml
services:
    app.host_voter:
        class: AppBundle\Security\hostVoter
        # small performance boost
        public: false
        tags:
            # big performance boost
            - { name: security.efficient_voter, type: ROLE, domain: HOUSE }
```

With this configuration, the voter above, will be called only for the `ROLE_HOUSE_*` attributes.

Note
----

[](#note)

The new access decision manager remains compatible with the original. So if you have some voters that are registered the old way, they will still work as expected (but called tons of time).

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~32 days

Total

4

Last Release

2946d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b12ed423a03cfb7eb41e4a0b5c1182ab30271cfc4f3f3e5962bb73873aca37f?d=identicon)[nykopol](/maintainers/nykopol)

---

Top Contributors

[![nykopol](https://avatars.githubusercontent.com/u/2706685?v=4)](https://github.com/nykopol "nykopol (11 commits)")

### Embed Badge

![Health badge](/badges/kinulab-efficient-vote-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kinulab-efficient-vote-bundle/health.svg)](https://phpackages.com/packages/kinulab-efficient-vote-bundle)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

572612.5k1](/packages/scheb-2fa)[mapbender/mapbender

Mapbender library

10117.0k5](/packages/mapbender-mapbender)

PHPackages © 2026

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