PHPackages                             jstewmc/authorize-group - 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. jstewmc/authorize-group

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

jstewmc/authorize-group
=======================

Authorize access-control-list (ACL) group

v1.0.0(9y ago)017MITPHPPHP ^7.0

Since Aug 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jstewmc/authorize-group)[ Packagist](https://packagist.org/packages/jstewmc/authorize-group)[ RSS](/packages/jstewmc-authorize-group/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

authorize-group
===============

[](#authorize-group)

Authorize a *group* to perform an *action* on a *resource*.

Terminology
-----------

[](#terminology)

This library uses the following terminology:

- A *user* is a person.
- A *resource* is a thing, typically a model name. By convention, resources are plural and lower-case (e.g., `'users'`).
- An *action* is something done to a resource, typically a CRUD operation. By convention, actions are singular, present-tense, and lower-case (e.g., `'create'`).
- A *permission* is the right to perform an *action* on a *resource* (e.g., `'create'` + `'users'`).
- A *role* is a named set of permissions. By convention, roles are singular and lower-cased (e.g., `'administrator'`)
- A *group* is a set of users with a *unique* name. By convention, groups are plural and lower-case (e.g., `'administrators'`).

Methodology
-----------

[](#methodology)

This library's methodology is rather simple:

1. A *user* is assigned to a *group*.
2. A *group* is assigned one or more *roles*.
3. A *role* is granted one or more *permissions*.
4. A *permission* allows an *action* on a *resource*.

While *users* are assigned one or more *groups* in the database, a *group* is assigned a *role* and a *role* is assigned *permissions* in a configuration array.

Example
-------

[](#example)

Finally (haha):

```
use Jstewmc\AuthorizeGroup;

// grant permissions to roles
$roles = [
    // the "administrator" role...
    'administrator' => [
        // for the "users" resource...
        'users' => [
            // has the "create" action
            'create'
        ]
    ]
];

// assign roles to groups
$groups = [
    // the "administrators" group...
    'administrators' => [
        // has the "administrator" role
        'administrator'
    ]
];

// implement a group named "administrators"
$group = new class implements Group {
    public function getName(): string {
        return 'administrators';
    }
}

// create our authorization service
$authorizer = new Authorize($groups, $roles);

// is the group authorized to create users? (yes)
$authorizer($group, 'create', 'users');

// is the group authorized to delete users? (no)
$authorizer($group, 'delete', 'users');
```

That's about it!

License
-------

[](#license)

[MIT](https://github.com/jstewmc/authorize-group)

Author
------

[](#author)

[Jack Clayton](mailto:clayjs0@gmail.com)

Version
-------

[](#version)

### 1.0.0, August 16, 2016

[](#100-august-16-2016)

- Major release
- Fix `composer.json`
- Cleanup a few comments

### 0.1.0, August 3, 2016

[](#010-august-3-2016)

- Initial release

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3608d ago

Major Versions

v0.1.0 → v1.0.02016-08-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/50fecae0a7fd2119681bc133e496e7166b01a59f850a3c909e100bd427c6b28b?d=identicon)[Jstewmc](/maintainers/Jstewmc)

---

Top Contributors

[![jstewmc](https://avatars.githubusercontent.com/u/1192893?v=4)](https://github.com/jstewmc "jstewmc (6 commits)")

---

Tags

phpaccesslistaclcontrolauthorizegroupjstewmc

### Embed Badge

![Health badge](/badges/jstewmc-authorize-group/health.svg)

```
[![Health](https://phpackages.com/badges/jstewmc-authorize-group/health.svg)](https://phpackages.com/packages/jstewmc-authorize-group)
```

###  Alternatives

[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.6M47](/packages/santigarcor-laratrust)[2amigos/yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension

294282.0k15](/packages/2amigos-yii2-usuario)[gburtini/acl

Dependency free, simple access control lists for PHP.

3610.4k1](/packages/gburtini-acl)

PHPackages © 2026

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