Download the PHP package tomkyle/rbac without Composer

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

tomkyle/rbac

Role-based access control solution, extracted from my legacy codebase. It provides a permissions and roles system as well as a simple ACL implementation.

Scrutinizer Quality Score

Core concepts

Roles

A client may be associated with certain roles, e.g. Authors or Admins. These are stored in a RolesStorage object that contains role IDs.

ACL

A service may be restricted to certain roles. AccessControlList as an extension of RolesStorage will do that:

Permissions

A client may be allowed or disallowed to do certain things. PermissionsStorage will do that:

Installation

This library has no dependencies except a PDO connection. Install from command line or composer.json file:

Command line
composer require tomykle/rbac
composer.json
"require": {
    "tomkyle/rbac": "dev-master"
}
MySQL

This package comes with two MySQL dumps, install.sql.dist and install.sample-data.sql.dist. Simply execute their contents; former installs tables, indices and unique constraints, dropping existing tables; latter adds sample data. See comments in table info or field comments.

The databasa schema uses InnoDB tables for better transaction and relation handling, although currently not using these features (since I never have worked with it yet).

Database

Roles, Permissions and their respective associations to clients are stored in a bunch of database tables:

Table Description
tomkyle_roles Defines all roles (aka user groups) the application works with.
tomkyle_permissions Holds permissions the application works with.
tomkyle_permissions_roles_mm Associates permissions with one or many roles.
tomkyle_clients_roles_mm Associates a client with one or many roles.
tomkyle_clients_permissions_adjust Adjusts a clients' permissions, overriding the ones he is granted or permitted due to his roles

Administration

Sorry, currently there is no administration tool available. I used to manage them manually in the database. Anyhow, unique constraints will prevent you from adding doublettes. So if you have to delete a certain role or permission, do not forget the relation tables that refer to their primary key.


All versions of rbac with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 tomkyle/rbac contains the following files

Loading the files please wait ....