Download the PHP package binn/yii2-auth without Composer

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

yii2-auth

Auth is a module for the Yii PHP framework that provides a web user interface for Yii's built-in authorization manager (\yii\rbac\BaseManager). You can read more about Yii's authorization manager in the framework documentation under Authorization.

Auth based on original code of yii-auth extension and fully rewrited for using with Yii 2. Also fork contain all original releases for Yii 1.x.

At this moment module supports only DbManager.

Demo

Coming soon.

Usage

Setup

The preferred way to install this extension is through composer.

Add

to the require section of your composer.json file.

Add module to application config and configure authManager component:

Please note that while the module doesn't require you to use a database, if you wish to use yii\rbac\DbManager you need it's schema (it can be found in the framework under yii\rbac\migrations).

Configuration

Configure the module to suit your needs. Here's a list of the available configurations (with default values).

Checking access

When you wish to check if the current user has a certain permission you can use the User::can() method which can be access from anywhere in your application through Yii::$app like so:

In order to keep your permissions dynamic you should never check for a specific role or task, instead you should always check for an operation. For more information on Yii's authorization manager refer to the framework documentation on Authorization.

Checking access using a filter

You can also use a filter to automatically check access before controller actions are called. Operations used with this filter has to be named as follows (moduleId.)controllerId.actionId, where moduleId is optional.

For example

For more information on how filters work refer to the framework documentation on Controllers.

Versioning

Because Auth contain all versions from original library be careful with versions.

Version 1.x - for Yii 1.x Version 2.x - for Yii 2.x

Contributing

Please, send any issues and PR only for 2.x version. For original Yii 1.x module contribute to yii-auth


All versions of yii2-auth with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version 2.*
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 binn/yii2-auth contains the following files

Loading the files please wait ....