PHPackages                             josephcrowell/wn-passage-plugin - 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. josephcrowell/wn-passage-plugin

ActiveWinter-plugin[Authentication &amp; Authorization](/categories/authentication)

josephcrowell/wn-passage-plugin
===============================

Fast, Efficient permission system for controlling access to your website resources

2.0.2(2y ago)42702[1 PRs](https://github.com/josephcrowell/wn-passage-plugin/pulls)GPL-3.0-or-laterPHPPHP &gt;=7.0CI passing

Since May 6Pushed 3mo agoCompare

[ Source](https://github.com/josephcrowell/wn-passage-plugin)[ Packagist](https://packagist.org/packages/josephcrowell/wn-passage-plugin)[ Docs](https://www.computerlink.com.au)[ Patreon](https://www.patreon.com/josephcrowell)[ RSS](/packages/josephcrowell-wn-passage-plugin/feed)WikiDiscussions master Synced 1mo ago

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

Passage plugin
==============

[](#passage-plugin)

 [ ![](https://camo.githubusercontent.com/f52ee03d39383040e54948682fa62cdc67669e713944ee3dc75859bfc7b651ec/68747470733a2f2f7472617669732d63692e6f72672f6a6f7365706863726f77656c6c2f776e2d706173736167652d706c7567696e2e7376673f6272616e63683d6d6173746572) ](https://travis-ci.org/josephcrowell/wn-passage-plugin) [ ![](https://camo.githubusercontent.com/2c8c2b28487b09ba907590b19bae8bc8cea76ca3e9b1e3b3989ca44b1c441eb7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f57696e74657220434d532d506c7567696e2d2532334545373230332e737667) ](https://wintercms.com/plugin/josephcrowell-passage) [ ![](https://camo.githubusercontent.com/1576df4d95a30b61fed99d6564293daaedbbd481434a8aeeb26617a9ac22d8cd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f72745f6f6e2d50617472656f6e2d677265656e2e737667) ](https://www.patreon.com/josephcrowell) [ ![](https://camo.githubusercontent.com/8d232c8c7a4ea26550fd2328ff320aac76010c9d55879a66d97024d2f12b70e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d434325323042592d2d5341253230342e302d6c69676874677265792e737667) ](https://creativecommons.org/licenses/by-sa/4.0/)

( Installation code : **josephcrowell.wn-passage-plugin** ) Requires ( **Winter.User** )

This plugin adds a front end user group permission system to [WinterCMS](http://wintercms.com).

Download the plugin to the plugins directory and logout and log in back into Winter backend. Go to the Passage Permissions page via the side menu in users in the backend and add your permissions.

### User Permision / Passage Permission Entry

[](#user-permision--passage-permission-entry)

In the backend under Users (Winter.Users) you will find a sidemenu item called **"Passage Permissions".** This is where you enter your permission names and an optional description.

In the backend under Users you will find a button at the top called **"User Groups"**. Press button to see groups. When editing a group you will find check boxes at the bottom for each "Passage Permission". This is where you assign permissions for each user group.

### User Overrides

[](#user-overrides)

In the backend under Users (Winter.Users) you will find a sidemenu item called **"User Overrides".**

User overrides allow you to add permissions to individual users. You can also remove permission from users by adding a override and unchecking the **Grant** checkbox.

### User Permisions in Pages or Partials

[](#user-permisions-in-pages-or-partials)

On a page you may restrict access to a portion of view by using the following twig functions:

```
{% if can('calendar_meetings') %}

This will show only if the user belongs to a Winter.User Usergroup that includes the permission named "calendar_meetings".

{% else %}

This will show if the user DOES NOT belong to a Winter.User Usergroup that include the permission named "calendar_meetings".

{% endif %}

{% if inGroup('my_admins') %}

This will show only if the user belongs to a Winter.User Usergroup that has the code "my_admins".

{% else %}

This will show if the user DOES NOT belong to a Winter.User Usergroup that has the code "my_admins".

{% endif %}

This will show for all users regardless of permissions.

{% if inGroupName('My Admins') %}

This will show only if the user belongs to a Winter.User Usergroup that is named "My Admins".

{% else %}

This will show if the user DOES NOT belong to a Winter.User Usergroup that is named "My Admins".

{% endif %}

This will show for all users regardless of permissions.

```

Available Twig Functions
------------------------

[](#available-twig-functions)

- can('PermissionName') - Check a passage permission name
- hasPermissionName('PermissionName') - Check a passage permission name
- hasPermissionNames(\['PermissionName1','PermissionName2','PermissionName3'\]) - Check an array of passage permission names
- hasPermission(PermissionId) (where PermissionId is an integer) - Check a passage permission id
- hasPermissions(\[PermissionId1,PermissionId2,PermissionId3\]) - Check an array of passage permission ids
- inGroupName('GroupName') - Check a passage group name
- inGroupNames(\['Group Name','Group Name 2','Group Name 3'\]) - Check an array of passage group names
- inGroup('GroupCode') - Check a passage group code
- inGroups(\['GroupCode1','GroupCode2','GroupCode3'\]) - Check an array of passage group codes

### User Permisions in Your Own Plugins

[](#user-permisions-in-your-own-plugins)

```
// Passage Service Methods can be accessed in one of two ways:
use JosephCrowell\Passage\Classes\PermissionsService as PassageService;
$permissions_by_name = PassageService::passagePermissions(); // by Alias

//OR
$permissions_by_name = app('PassageService')::passagePermissions(); // by App Service

// Get all permissions for the user in an array
$permissions_by_name = PassageService::passagePermissions();

/**
* OR
*
* In your plugin you may restrict access to a portion of code:
**/

// check for permission directly using hasPermissionName( $permission_name )
$permissionGranted = PassageService::hasPermissionName('view_magic_dragon');
if($permissionGranted) {
 // Do stuff
}

/**
* OR
*
*  Lets say you have a model that uses a permission field containg the id of a
*   permission permission and want to see if model permission matches.
*
*  Example:
*  $model->perm_id = 5 which came from a dropdown that contained permissions
*  from PassageService::passagePermissions();
**/

$model = Model::first();
// check for permission directly using hasPermission( $permission_id )
if(PassageService::hasPermission($model->perm_id)) {
    // Do Stuff
}else{
    // Do other Stuff if user does NOT have permission
}

/**
* OR
*
*  Get Array of Groups
**/

// You can get array of the users groups keyed by the code of the group
$groups = PassageService::passageGroups()

/**
* OR
*
*  Check group membership by group code
**/

// use hasGroup($group_code) to check membership
$isCool = PassageService::hasGroup('cool_people')

/**
* OR
*
*  Check group membership by group Name
*   Note: Group names are not guaranteed to be unique.
*   DO NOT CHECK BY GROUP NAME if security is an issue.
**/

// use hasGroupName($group_name) to check membership
$isInGroupNamedCool = PassageService::hasGroupName('Cool')

```

Available Passage Service Methods
---------------------------------

[](#available-passage-service-methods)

- passagePermissions() - Get an array of all approved passage permissions for the user
- can($permission\_name) - (alias of hasPermissionName())
- hasPermissionName($permission\_name) - Check a passage permission name
- hasPermission(integer $permission\_id) - Check a passage permission id
- hasPermissions(array $check\_permission\_ids) - Check an array of passage permission ids
- hasPermissionNames(array $check\_permissions) - Check an array of passage permission names
- passageGroups() - Get an array of all approved passage groups for the user
- inGroupName($group\_name) - Check a passage group name
- hasGroupName($group\_name) - (alias of inGroupName())
- inGroup($group\_code) - Check a passage group code
- hasGroup($group\_code) - (alias of inGroup())
- inGroups(array $check\_group\_codes) - Check an array of passage group ids
- inGroupNames(array $check\_groups) - Check an array of passage group names

These methods are also available directly on the \[Winter\\User\\Models\\User\] model
-------------------------------------------------------------------------------------

[](#these-methods-are-also-available-directly-on-the-winterusermodelsuser-model)

- $user-&gt;hasPermission(integer $permission\_id) - Check a passage permission id
- $user-&gt;hasPermissionName($permission\_name) - Check a passage permission name
- $user-&gt;hasPermissions(array $check\_permission\_ids) - Check an array of passage permission ids
- $user-&gt;hasPermissionNames(array $check\_permissions) - Check an array of passage permission names
- $user-&gt;inGroup($group\_code) - Check a passage group code
- $user-&gt;inGroupName($group\_name) - Check a passage group name
- $user-&gt;inGroups(array $check\_group\_codes) - Check an array of passage group ids
- $user-&gt;inGroupNames(array $check\_groups) - Check an array of passage group names

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance53

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.6% 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 ~343 days

Total

4

Last Release

801d ago

Major Versions

1.3.0 → 2.0.02022-11-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/23add7dafeb794a19459b64e72be7a2e2dc0613beffd18be42b526080ebeb955?d=identicon)[josephcrowell](/maintainers/josephcrowell)

---

Top Contributors

[![josephcrowell](https://avatars.githubusercontent.com/u/2770395?v=4)](https://github.com/josephcrowell "josephcrowell (59 commits)")[![firemankurt](https://avatars.githubusercontent.com/u/9581757?v=4)](https://github.com/firemankurt "firemankurt (25 commits)")[![ndcisiv](https://avatars.githubusercontent.com/u/827509?v=4)](https://github.com/ndcisiv "ndcisiv (1 commits)")[![ribsousa](https://avatars.githubusercontent.com/u/2750974?v=4)](https://github.com/ribsousa "ribsousa (1 commits)")

---

Tags

AuthenticationusercmspermissionoverridegroupwinterwintercmsPassage

### Embed Badge

![Health badge](/badges/josephcrowell-wn-passage-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/josephcrowell-wn-passage-plugin/health.svg)](https://phpackages.com/packages/josephcrowell-wn-passage-plugin)
```

###  Alternatives

[winter/wn-user-plugin

User plugin for Winter CMS

1233.5k13](/packages/winter-wn-user-plugin)[asgardcms/user-module

User module for AsgardCMS. Handles the authentication and authorisation as well as the user management.

1129.5k2](/packages/asgardcms-user-module)

PHPackages © 2026

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