PHPackages                             phpmv/ubiquity-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. [Framework](/categories/framework)
4. /
5. phpmv/ubiquity-acl

ActiveExtension[Framework](/categories/framework)

phpmv/ubiquity-acl
==================

Access Control Lists for Ubiquity framework

0.0.15(3y ago)11.0kApache-2.0PHPPHP &gt;=8.0

Since Oct 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/phpMv/ubiquity-acl)[ Packagist](https://packagist.org/packages/phpmv/ubiquity-acl)[ RSS](/packages/phpmv-ubiquity-acl/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

ubiquity-acl
============

[](#ubiquity-acl)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/88cd867925903598cf0524e644227a003d5da984341435e601eaae65ffbb1bf5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068704d762f75626971756974792d61636c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/phpMv/ubiquity-acl/?branch=main)[![Build Status](https://camo.githubusercontent.com/0250d74f6844c80194abad5ef072ec567e15f1db2f794a9c0b472e57efe2562b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068704d762f75626971756974792d61636c2f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/phpMv/ubiquity-acl/build-status/main)[![Code Intelligence Status](https://camo.githubusercontent.com/5cb039bcd8334081a62665be21aced28c2981ecd02931b03fc39c82567777079/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068704d762f75626971756974792d61636c2f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d61696e)](https://scrutinizer-ci.com/code-intelligence)[![Code Coverage](https://camo.githubusercontent.com/551ed7d11c76e7bd5083276b4450681d5c2b95e1f552e685ec4955ffd1016370/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068704d762f75626971756974792d61636c2f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/phpMv/ubiquity-acl/?branch=main)

Access control lists for Ubiquity framework

Samples
-------

[](#samples)

### Defining ACLs at runtime

[](#defining-acls-at-runtime)

#### One by one

[](#one-by-one)

```
AclManager::start();
AclManager::addRole('@USER');
AclManager::addResource('Home');
AclManager::addPermission('READ',1);
AclManager::allow('@USER','Home','READ');
```

#### By grouping

[](#by-grouping)

```
AclManager::start();
AclManager::addAndAllow('@USER','Home','READ');
```

### Defining ACLs with annotations or attributes

[](#defining-acls-with-annotations-or-attributes)

#### Starting

[](#starting)

```
use Ubiquity\security\acl\AclManager;
use Ubiquity\security\acl\persistence\AclCacheProvider;

AclManager::start();
AclManager::initFromProviders([
	new AclCacheProvider()
]);
```

#### Defining ACLs in controllers

[](#defining-acls-in-controllers)

##### A controller as a resource, authorized for a role

[](#a-controller-as-a-resource-authorized-for-a-role)

With annotations:

```
namespace controllers;
/**
 * @resource('Main')
 * @allow('role'=>'@USER')
 */
class TestAclController extends ControllerBase {
	use AclControllerTrait;
}
```

With attributes:

```
namespace controllers;
use Ubiquity\attributes\items\acl\Resource;
use Ubiquity\attributes\items\acl\Allow;

#[Resource('Main')]
#[Allow(role: '@USER')]
class TestAclController extends ControllerBase {
	use AclControllerTrait;
}
```

#### Overriding

[](#overriding)

It is necessary to override the \_getRole method so that it returns the role of the active user:

```
namespace controllers;
use Ubiquity\attributes\items\acl\Resource;
use Ubiquity\attributes\items\acl\Allow;use Ubiquity\utils\http\USession;
use Ubiquity\utils\http\USession;

#[Resource('Main')]
#[Allow(role: '@USER')]
class TestAclController extends ControllerBase {
	use AclControllerTrait;

	public function _getRole(){
	    $activeUser=USession::get('activeUser');
	    if(isset($activeUser)){
	        return $activeUser->getRole();
	    }
	}
}
```

### Defining ACLs with Database

[](#defining-acls-with-database)

The ACLs defined in the database are additional to the ACLs defined via annotations or attributes.

#### Initializing

[](#initializing)

The initialization allows to create the tables associated to the ACLs (`Role`, `Resource`, `Permission`, `AclElement`). It needs to be done only once, and in dev mode only.

```
use Ubiquity\controllers\Startup;
use Ubiquity\security\acl\AclManager;

$config=Startup::$config;
AclManager::initializeDAOProvider($config, 'default');
```

#### Starting

[](#starting-1)

In `app/config/services.php` file :

```
use Ubiquity\security\acl\AclManager;
use Ubiquity\security\acl\persistence\AclCacheProvider;
use Ubiquity\security\acl\persistence\AclDAOProvider;
use Ubiquity\orm\DAO;

DAO::start();//Optional, to use only if dbOffset is not default

AclManager::start();
AclManager::initFromProviders([
	new AclCacheProvider(), new AclDAOProvider($config)
]);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Recently: every ~106 days

Total

15

Last Release

1231d ago

PHP version history (3 changes)0.0.1PHP ^7.4

0.0.2PHP &gt;=7.4

0.0.10PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2511052?v=4)[Jean-Christophe HERON](/maintainers/jcheron)[@jcheron](https://github.com/jcheron)

---

Top Contributors

[![jcheron](https://avatars.githubusercontent.com/u/2511052?v=4)](https://github.com/jcheron "jcheron (245 commits)")

---

Tags

phpsecurityubiquity-frameworkphpframeworksecurityDevtoolsaclmvctoolsphp framework

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/phpmv-ubiquity-acl/health.svg)

```
[![Health](https://phpackages.com/badges/phpmv-ubiquity-acl/health.svg)](https://phpackages.com/packages/phpmv-ubiquity-acl)
```

PHPackages © 2026

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