PHPackages                             railken/permission - 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. railken/permission

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

railken/permission
==================

v1.0.1(8y ago)013MITPHPPHP &gt;=7.0.0

Since Oct 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/railken/permission)[ Packagist](https://packagist.org/packages/railken/permission)[ RSS](/packages/railken-permission/feed)WikiDiscussions master Synced 3d ago

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

Permission
==========

[](#permission)

A very simple system to handle permissions

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

[](#requirements)

PHP 7.0.0 or later.

Composer
--------

[](#composer)

You can install it via [Composer](https://getcomposer.org/) by typing the following command:

```
composer require railken/permission
```

Usage
-----

[](#usage)

Add the trait, check [here](https://github.com/railken/permission/blob/master/src/Traits/CanTrait.php) for more info.

```
use Railken\Permission\Traits\CanTrait;

class User
{
    use CanTrait;
}
```

Load all permissions using `setPermissions`

```
$user->setPermissions([
    'me.*',
    'all.show',
]);
```

Note: You can use `*` as a wildcard.

Now you're free to test the permission of user

```
$user->can('me.anything');      // true
$user->can('foo');              // false
$user->can('all.wrong');        // false
$user->can('all.show');         // true
$user->can('all.show.wrong');   // false
```

Check [tests](https://github.com/railken/permission/blob/master/tests/PermissionTest.php) to see more examples;

License
-------

[](#license)

Open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

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

Total

2

Last Release

3125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea4a9e56b247008aea4d20bb8a555a9f0cb69d0ac69aa8417b29fc37efa2eb5c?d=identicon)[railken](/maintainers/railken)

---

Top Contributors

[![railken](https://avatars.githubusercontent.com/u/26530231?v=4)](https://github.com/railken "railken (12 commits)")

---

Tags

librarypermissionphpphplibrarypermission

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/railken-permission/health.svg)

```
[![Health](https://phpackages.com/badges/railken-permission/health.svg)](https://phpackages.com/packages/railken-permission)
```

###  Alternatives

[litesaml/lightsaml

SAML 2.0 PHP library

1055.5M18](/packages/litesaml-lightsaml)[2amigos/2fa-library

2 Factor Authentication (2FA) library

34367.1k7](/packages/2amigos-2fa-library)

PHPackages © 2026

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