PHPackages                             mrjulio/rapture-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. mrjulio/rapture-acl

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

mrjulio/rapture-acl
===================

Rapture ACL component

v1.0.1(8y ago)013MITPHP

Since Jun 15Pushed 8y agoCompare

[ Source](https://github.com/mrjulio/rapture-acl)[ Packagist](https://packagist.org/packages/mrjulio/rapture-acl)[ Docs](http://rapture.iuliann.ro)[ RSS](/packages/mrjulio-rapture-acl/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (3)Used By (0)

Rapture ACL
===========

[](#rapture-acl)

[![PhpVersion](https://camo.githubusercontent.com/b3b25db823332877216c2e619ac9bd10df392da948c782b2c4092064530afa61/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d352e342d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](#)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](#)

About
-----

[](#about)

Rapture-ACL is an simple authorization layer library for PHP.

Simple concept: `REQUESTER` wants to do an `ACTION` on a `RESOURCE`.

Requirements
------------

[](#requirements)

- php v5.4

Install
-------

[](#install)

```
composer require mrjulio/rapture-acl
```

Quick start
-----------

[](#quick-start)

### Requester vs Resource

[](#requester-vs-resource)

An User (requester) wants to edit (action) a model (resource).

```
class User implements \Rapture\Acl\Definition\RequesterInterface
{
    /**
     * @return array
     */
    public function requesterGroups()
    {
        return ['admin'];
    }

    /**
     * @return int
     */
    public function requesterId()
    {
        return $this->id;
    }
}
```

```
class Model implements \Rapture\Acl\Definition\ResourceInterface
{
    /**
     * @return array
     */
    public function resourceGroups()
    {
        return ['models'];
    }

    /**
     * @return string|int
     */
    public function resourceId()
    {
        return $this->getId();
    }

    /**
     * @return int
     */
    public function ownerId()
    {
        return $this->getCreatedBy();
    }
}
```

### Available Actions

[](#available-actions)

```
class Acl
{
    // resource, requester, owner
    const ANY   = '*';
    const OWNER = '@';

    // access
    const ALLOW = true;
    const DENY = false;

    // actions
    const VIEW = 2;         // 2^1
    const SEARCH = 4;       // 2^2
    const ADD = 8;          // 2^3
    const EDIT = 16;        // 2^4
    const DELETE = 32;      // 2^5
    const UNDO = 64;        // 2^6
    const RENAME = 128;     // 2^7
    const DESTROY = 256;    // 2^8
    const ACTION1 = 512;    // 2^9
    const ACTION2 = 1024;   // 2^10
    const ACTION3 = 2048;   // 2^11
    const ACTION4 = 4096;   // 2^12
    const ACTION5 = 8192;   // 2^13

    const ALL = 16382;
}
```

### Usage

[](#usage)

```
$adapter = new \Rapture\Acl\Adapter\Php();
$adapter->setDefault(\Rapture\Acl\Acl::DENY);

$rules = [
    //  requester - resource - actions (optional) - allow (optional)

    // allow admins to all resources to ALL actions
    ['admin', Acl::ANY, Acl::ALL, Acl::ALLOW],

    // allow guest to view specific resources
    ['guest', 'resource-x', Acl::VIEW, Acl::ALLOW],
];
$adapter->addRules($rules);

$adapter->hasAccess(new Requester, new Resource, Acl::EDIT);
```

About
-----

[](#about-1)

### Author

[](#author)

Iulian N. `rapture@iuliann.ro`

### Testing

[](#testing)

```
cd ./test && phpunit

```

### Credits

[](#credits)

-
-

### License

[](#license)

Rapture PHP ACL is licensed under the MIT License - see the `LICENSE` file for details.

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

3191d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1187463?v=4)[MrJulio](/maintainers/MrJulio)[@mrjulio](https://github.com/mrjulio)

---

Top Contributors

[![mrjulio](https://avatars.githubusercontent.com/u/1187463?v=4)](https://github.com/mrjulio "mrjulio (3 commits)")

---

Tags

library

### Embed Badge

![Health badge](/badges/mrjulio-rapture-acl/health.svg)

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

###  Alternatives

[litesaml/lightsaml

SAML 2.0 PHP library

1076.6M27](/packages/litesaml-lightsaml)[2amigos/2fa-library

2 Factor Authentication (2FA) library

34396.1k7](/packages/2amigos-2fa-library)[spinen/laravel-discourse-sso

Integrate Discourse SSO into Laravel.

46101.0k](/packages/spinen-laravel-discourse-sso)

PHPackages © 2026

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