PHPackages                             slimphp-api/slim-acl - 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. slimphp-api/slim-acl

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

slimphp-api/slim-acl
====================

A middleware module for Slim3 to provide ACL using ZF2's Zend\\Permissions\\Acl

1.0.0(9y ago)177.6k10MITPHPPHP ^5.6 || ^7.0

Since Jan 10Pushed 9y ago4 watchersCompare

[ Source](https://github.com/slimphp-api/slim-acl)[ Packagist](https://packagist.org/packages/slimphp-api/slim-acl)[ RSS](/packages/slimphp-api-slim-acl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

slim-acl
========

[](#slim-acl)

ACL middleware for slim, using Zend\\Permissions\\Acl

[![Coverage Status](https://camo.githubusercontent.com/7b0aba7b08c64d1e19aefd29082f77e64c88017b72114b5dccb9bb6b643d9377/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f736c696d7068702d6170692f736c696d2d61636c2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/slimphp-api/slim-acl?branch=master)[![Code Climate](https://camo.githubusercontent.com/14bef0a52429b2939bec6f0e87f8ce1c4e6a73d7d65caef18762b53296b5bd68/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736c696d7068702d6170692f736c696d2d61636c2f6261646765732f6770612e737667)](https://codeclimate.com/github/slimphp-api/slim-acl)[![Build Status](https://camo.githubusercontent.com/9ebfa20f7b85aa5efb68993e48cd434fbe74bf359b9c5bb6bd0898f55e66195e/68747470733a2f2f7472617669732d63692e6f72672f736c696d7068702d6170692f736c696d2d61636c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slimphp-api/slim-acl)

Configuration passed into the middleware constructor should look like:

```
[
    'default_role' => 'guest',
    'roles' => [
        'guest' => [],
        'user'  => ['guest'],
        'admin' => ['user']
    ],
    /*
     * just a list of generic resources for manual checking
     * specified here so can be used in the code if needs be
     */
     'resources' => [
         'banana' => null,
         'orange' => null,
     ],
    // where we specify the guarding!
    'guards' => [
        /*
         * list of resource to roles to permissions
         * optional
         * if included all resources default to deny unless specified.
         */
        'resources' => [
            ['banana', ['user'], ['peel']],
            ['banana', ['admin']],
            ['orange', ['guest'], ['peel']],
            ['orange', ['user'], ['eat']],
        ],
        /*
         * list of literal routes for guarding.
         * optional
         * if included all routes default to deny unless specified.
         * Similar format to resource 'resource' route, roles, 'permission' action
         * ['route', ['roles'], ['methods',' methods1']]
         */
        'routes' => [
            ['/home',       ['user'],  ['get']],
            ['/user',       ['admin'], ['get', 'post']], // $app->map(['POST', 'PUT'], '/user', ...);
            ['/user/{id}',  ['user'],  ['get']], // $app->map(['GET'], '/user/{id}', ...);
        ],
        /*
         * list of callables to resolve against
         * optional
         * if included all callables default to deny unless specified.
         * 'permission' section is combined into the callable section
         * ['callable', ['roles']]
         */
        'callables' => [
            ['App\Controller\UserController',           ['user']], // $app->map(['GET'], '/user',      'App\Controller\UserController'); class with __invoke
            ['App\Controller\UserController:getAction', ['user']], // $app->map(['GET'], '/user/{id}', 'App\Controller\UserController:getAction'); class and method
        ]
    ]
]

```

**Important:** The route should be determined before the app middlewares are being fired by:

```
$app = new Slim\App([
    'settings'  => [
        'determineRouteBeforeAppMiddleware' => true,
    ]
]);

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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

Unknown

Total

1

Last Release

3415d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8eead2f413dc6c16192320a2529534ed3f145c4f523fcadcc6af85c6be578f2c?d=identicon)[gabriel403](/maintainers/gabriel403)

---

Top Contributors

[![gabriel403](https://avatars.githubusercontent.com/u/118638?v=4)](https://github.com/gabriel403 "gabriel403 (11 commits)")[![bnf](https://avatars.githubusercontent.com/u/473155?v=4)](https://github.com/bnf "bnf (1 commits)")[![jcchavezs](https://avatars.githubusercontent.com/u/3075074?v=4)](https://github.com/jcchavezs "jcchavezs (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slimphp-api-slim-acl/health.svg)

```
[![Health](https://phpackages.com/badges/slimphp-api-slim-acl/health.svg)](https://phpackages.com/packages/slimphp-api-slim-acl)
```

###  Alternatives

[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[jeremykendall/slim-auth

Authorization and authentication for the Slim Framework using ZF2 Authentication and Acl components

24824.6k](/packages/jeremykendall-slim-auth)[openeuropa/oe_authentication

Authentication against the OpenEuropa Authentication service.

17314.8k2](/packages/openeuropa-oe-authentication)

PHPackages © 2026

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