Download the PHP package josephcrowell/wn-passage-plugin without Composer

On this page you can find all versions of the php package josephcrowell/wn-passage-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wn-passage-plugin

Passage plugin

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

This plugin adds a front end user group permission system to WinterCMS.

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

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

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

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

{% if can('calendar_meetings') %}

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

{% else %}

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

{% endif %}

{% if inGroup('my_admins') %}

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

{% else %}

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

{% endif %}

<p>This will show for all users regardless of permissions.</p>

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

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

{% else %}

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

{% endif %}

<p>This will show for all users regardless of permissions.</p>

Available Twig Functions

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


All versions of wn-passage-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
composer/installers Version ~1.0
winter/wn-user-plugin Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package josephcrowell/wn-passage-plugin contains the following files

Loading the files please wait ....