Download the PHP package kduma/permissions without Composer

On this page you can find all versions of the php package kduma/permissions. 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 permissions

L5-permissions

Latest Stable Version Total Downloads Latest Unstable Version License SensioLabsInsight StyleCI

Simple (really?) package to provide Roles and Permissions to Laravel 5.1

Setup

Add the package to the require section of your composer.json and run composer update

"kduma/permissions": "^1.1"

Then add the Service Provider to the providers array in config/app.php:

KDuma\Permissions\PermissionsServiceProvider::class,

Then add the Facades to the aliases array in config/app.php:

'Permissions'        => KDuma\Permissions\Facades\Permissions::class,
'PermissionsManager' => KDuma\Permissions\Facades\PermissionsManager::class,

Then add the Middleware's to the routeMiddleware array in app/Http/Kernel.php:

'permission' => \KDuma\Permissions\Middleware\Permission::class,
'role' => \KDuma\Permissions\Middleware\Role::class,

in your User model (app/User.php) add following line:

use \KDuma\Permissions\Permissions;

Run the following command to copy migrations:

php artisan vendor:publish --provider="KDuma\Permissions\PermissionsServiceProvider" --tag="migrations"

In SampleMigrations folder are examples you can use or make new based on.

Usage

Protecting controllers and routes

You can use two Middleware's: permission and role

or

You can provide more than one role/permission in one call by separating them using :. For example: permission:perm1:perm2:perm3. Middleware refuses access if user hasn't any of provided permissions/roles.

Checking permissions in views

You can use Permissions facade:

or

Creating/deleting roles and permissions

To manage roles and permissions you can use PermissionsManager Facaade.
The easiest way to manage permissions is putting them in migrations files.

PermissionsManager Facaade has bunch of usefull methods:

Admin role

As default admin role is setted to be root role. Root role always has all permissions. You can change it in configuration file.

Extending

Models

You are free to extend Permission and Role models.
If you extend, set model path in configuration (in ConfigServiceProvider):

Sample extended model:

Roles and Permissions from associated models

For example if your user is associated to an Member object that have own role, you can import them by placing this sample method in your User model:

Packagist

View this package on Packagist.org: kduma/permissions


All versions of permissions with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 5.*
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 kduma/permissions contains the following files

Loading the files please wait ....