Download the PHP package deadmantfa/yii2-rbac without Composer

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

Yii 2 JustCoded RBAC Extension (Forked)

Yii2

This is a fork of the Yii 2 RBAC extension by JustCoded. It extends the RBAC Manager with a route-based access control system, offering additional features and compatibility with modern PHP versions.


Features

Pre-defined Roles and Permissions

The extension provides the following pre-defined roles and permissions:

Permissions:

Roles:


Routes Scanner

The extension includes a feature to scan your project files and automatically import permissions for:

You can create or assign roles and permissions to configure your application's high-level access control.


Route Access Filter

Easily restrict access to specific parts of your site based on roles or permissions. The extension provides a filter similar to Yii's AccessControl, enabling route-based permissions checks. If access is denied, a 403 Forbidden error is triggered.


GUI for Managing Roles and Permissions

A simple GUI is included to manage roles and permissions directly from the application.

Note: The GUI is in alpha. Avoid sharing access to this interface with end-users.


Installation

Install the extension via Composer:

Alternatively, add the following to your composer.json:


Configuration

Component Setup

Add the RBAC module and authManager configuration in your application:


Bootstrap 4 Themes Support

By default, the views use Bootstrap 3 via yii2-bootstrap. For Bootstrap 4 support, update the container configuration:

Note: Add yiisoft/yii2-bootstrap4 to your composer.json.


Basic RBAC Configuration

Follow the official Yii 2 RBAC documentation to configure RBAC storage (e.g., create necessary files or database tables).

For DbManager, initialize the database tables with the following migration command:


Initialize Base Roles

Run the following commands to set up default roles and permissions:

For Advanced Template:

For Basic Template:


Usage

GUI Interface

Access the RBAC GUI by navigating to the module's configured route. Use the GUI to manage roles and permissions.

Note: The role-permission selector is a temporary solution and may not display a proper tree structure. This will be addressed in future updates.


Route Access Filter

Use the RouteAccessControl filter to enforce route-based access control. The filter checks permissions during each request and throws a 403 Forbidden error for unauthorized routes.

Per Controller

Globally


Example Project

You can see an example of this RBAC extension in action in the Yii2 Starter Kit.



All versions of yii2-rbac with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.0
yiisoft/yii2 Version ^2.0.51
kartik-v/yii2-widget-select2 Version ^2.2.0
yiisoft/yii2-bootstrap4 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 deadmantfa/yii2-rbac contains the following files

Loading the files please wait ....