Download the PHP package antonyz89/yii2-rbac without Composer

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

yii2-rbac

Donate with PayPal

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

Add bootstrap and module in to main.php


Applying Rules

1 - Add AccessControl to your Controller's Behaviour

`

2 - Create a rbac_profile_id to your identity class

php yii migrate/create add_rbac_profile_id_to_user_table

3 - use php yii migrate

3.1 - Now, include it on _form.php and Class of your identity.

3.2 - Add getRbacProfile()

3.3 - include it on rules()

4 - Access http://localhost/rbac or http://localhost?r=rbac and create a Profile with Controllers and Actions that you want whoever has this Profile to be able to access these Controllers and Actions

5 - When your Identity tries to access an existing Controller/Action in his Profile nothing will happen, but if you try to access a Controller/Action that does not exist in his Profile, an error will appear:

Error at access http://localhost/category/update?id=16

--

If you use AdminLTE, you can use my modified menu widget that works with RBAC and hides/displays menus according to the controllers/actions contained in the logged Identity's Profile, in addition to supporting roles like "@" and "?"

You can generate a migration with your current data of RBAC clicking on 'Generate Migration' button:

You can find the migration at 'console/migrations' and run using php yii migrate


Conditional Blocks

You can create blocks for each controller added to the profile. Each block can contain a specific condition to allow access to the user to that controller and yours actions.

In this case, all users with user_level = 2 or email = '[email protected]' can access this block.


All versions of yii2-rbac with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
yiisoft/yii2 Version ~2.0.6
yiisoft/yii2-bootstrap4 Version ^2.0
antonyz89/yii2-many-to-many Version ^0.3
rawr/t-regx Version ^0.9
kartik-v/yii2-widget-select2 Version ^2.1.0
kartik-v/yii2-grid Version ^3.2
symfony/polyfill-php80 Version ^1.18
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 antonyz89/yii2-rbac contains the following files

Loading the files please wait ....