PHPackages                             madlines/common-security-resolver - 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. madlines/common-security-resolver

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

madlines/common-security-resolver
=================================

Simple voters-based access resolver

1.1(10y ago)1811MITPHPPHP &gt;=5.5

Since Oct 14Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Madlines/Common-Security-Resolver)[ Packagist](https://packagist.org/packages/madlines/common-security-resolver)[ RSS](/packages/madlines-common-security-resolver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (1)

Madlines Common Security Resolver
=================================

[](#madlines-common-security-resolver)

[![Build Status](https://camo.githubusercontent.com/8db09a2a10b21a7aeb4223036da4499dfbc59ec7cd4fb80a2f147fd25b47a4ea/68747470733a2f2f7472617669732d63692e6f72672f4d61646c696e65732f436f6d6d6f6e2d53656375726974792d5265736f6c7665722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Madlines/Common-Security-Resolver)

This is a very simple voters-bases security resolver. It gets a list of voters which work in a middleware fashion and it exposes a `isGranted` method which can ask voters if user can perform a specified task.

Voters don't have to implement any interface. To make that library more generic it uses duck typing instead. Voters need to be objects implementing one public method named as you like.

Tasks can be whatever you like. Those can be objects or just string. It's up to your voters to tell if they support it.

Usage:
------

[](#usage)

Prepare a voter like that

```
