PHPackages                             coolcsn/csn-authorization - 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. [Database &amp; ORM](/categories/database)
4. /
5. coolcsn/csn-authorization

ActiveLibrary[Database &amp; ORM](/categories/database)

coolcsn/csn-authorization
=========================

Authorization based on DoctrineORMModule and ACL

0.1.0(12y ago)133.5k13[10 issues](https://github.com/coolcsn/CsnAuthorization/issues)[1 PRs](https://github.com/coolcsn/CsnAuthorization/pulls)BSD-3-ClausePHPPHP &gt;=5.3.3

Since Oct 24Pushed 12y ago6 watchersCompare

[ Source](https://github.com/coolcsn/CsnAuthorization)[ Packagist](https://packagist.org/packages/coolcsn/csn-authorization)[ Docs](https://github.com/coolcsn/CsnAuthorization)[ RSS](/packages/coolcsn-csn-authorization/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

CsnAuthorization
================

[](#csnauthorization)

### What is CsnAuthorization?

[](#what-is-csnauthorization)

CsnAuthorization is an Authorization module based on `Access Control List` and `DoctrineORMModule`.

### What exactly does CsnAuthorization do?

[](#what-exactly-does-csnauthorization-do)

CsnAuthorization has been created with educational purposes to demonstrate how Authorization can be done. It is fully functional. Authorization is the process of giving access rights to a user on a set of resourses(in our case - controllers) and determining their privileges(in our case - actions) on those resourses.

### What's the use again?

[](#whats-the-use-again)

An alternative to BjyAuthorize, working in perfect harmony with *Doctrine* and the other Csn modules.

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

[](#installation)

- Installation via composer is supported, simply run (make sure you've set `"minimum-stability": "dev"` in your *composer.json* file): `php composer.phar require coolcsn/csn-authorization:dev-master`
- Configure referenced module ([CsnUser](https://github.com/coolcsn/CsnUser)) following its instructions.
- Add 'CsnAuthorization' to your application configuration in `config/application.config.php`. An example application configuration could look like the following:

```
'modules' => array(
    'Application',
    'DoctrineModule',
    'DoctrineORMModule',
    'CsnUser',
    'CsnAuthorization'
)

```

- Set up your **Access Control List** configuration by copying `acl.global.php.dist` (located in `vendor/coolcsn/csn-authorization/config` if you have installed via *Composer*) into your `config/autoload` directory (Remove the .dist part).
- **Recommended:** Run `./vendor/bin/doctrine-module orm:schema-tool:update` to update the database schema if you are going to store the ACL in the database (**Note:** You may need to force the update by adding ` --force` to the command).
- **Optional:** If you prefer to load the ACL from the database, make sure you've completed the previous step, then set `use_database_storage = true` in the acl config. Import the sample ACL located in `./vendor/coolcsn/CsnAuthorization/data/SampleData.sql`. You can easily do that with *PhpMyAdmin* for instance.

> ### Does it work?
>
> [](#does-it-work)

Navigate to a controller/action which has been allowed only for members in your ACL configuration and you should be redirected. Now login (preferably using CsnUser) and attempt that action again. Enjoy :)

Important Notes
---------------

[](#important-notes)

- Wherever you need the acl object, just call `$serviceLocator->get('acl')`. It will properly construct a *Zend\\Permissions\\Acl\\Acl* object based on the data in the config or the database.
- In your controllers or view scripts you can call `$this->isAllowed($resource, $privilege)` to check whether the current user has access to a resource.

Dependencies
------------

[](#dependencies)

This Module depends on the following Modules:

- DoctrineORMModule
- CsnUser (Decoupling - coming soon!!!)

Recommends
----------

[](#recommends)

- [coolcsn/CsnUser](https://github.com/coolcsn/CsnUser) - Authentication (login, registration) module.
- [coolcsn/CsnAclNavigation](https://github.com/coolcsn/CsnAclNavigation) - Navigation module;
- [coolcsn/CsnCms](https://github.com/coolcsn/CsnCms) - Content management system;

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

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

4631d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17485759?v=4)[wingman](/maintainers/wingman)[@Wingman](https://github.com/Wingman)

---

Top Contributors

[![revov](https://avatars.githubusercontent.com/u/4138535?v=4)](https://github.com/revov "revov (23 commits)")[![wingman007](https://avatars.githubusercontent.com/u/203479?v=4)](https://github.com/wingman007 "wingman007 (2 commits)")[![coolcsn](https://avatars.githubusercontent.com/u/3388479?v=4)](https://github.com/coolcsn "coolcsn (1 commits)")

---

Tags

doctrinezf2doctrine-orm-modulecsn-authorization

### Embed Badge

![Health badge](/badges/coolcsn-csn-authorization/health.svg)

```
[![Health](https://phpackages.com/badges/coolcsn-csn-authorization/health.svg)](https://phpackages.com/packages/coolcsn-csn-authorization)
```

###  Alternatives

[hounddog/doctrine-data-fixture-module

Zend Framework 2 Module that provides Doctrine Data-Fixture functionality

37335.9k9](/packages/hounddog-doctrine-data-fixture-module)[coolcsn/csn-user

Authentication based on DoctrineORMModule

346.9k2](/packages/coolcsn-csn-user)[mamuz/mamuz-blog

Provides blog feature for ZF2 with Doctrine

101.1k1](/packages/mamuz-mamuz-blog)

PHPackages © 2026

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