Download the PHP package craftcamp/php-abac without Composer

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

[CraftCamp] php-abac

Attribute-Based Access Control implementation library

Latest Stable Version Latest Unstable Version Build Status Code Coverage Scrutinizer Code Quality Total Downloads License

Introduction

This library is meant to implement the concept of ABAC in your PHP applications.

The concept is to manage access control using attributes : from users, from resources and environment.

It allows us to define rules based on the properties of the user object and optionally the accessed object.

These rules will be checked in your application to determine if an user is allowed to perform an action.

The following links explain what ABAC is :

Installation

Using composer :

Then you will have to configure the attributes and the rules of your application.

For more details about this, please refer to the dedicated documentation

Documentation

Usage Examples

Example with only user attributes defined in the rule

We have in this example a single object, representing the current user.

This object have properties, with getter methods to access the values.

For example, we can code :

The attributes checked by the rule can be :

User
isBanned = false

Example with both user and object attributes

The checked attributes can be :

User Group
isBanned = 0 isActive = 1
isPublic = 1

Example with dynamic attributes

Example with referenced attributes

The configuration shall be :

And then the code :

Example with cache

Example with multiple rules (ruleSet) for an unique rule. Each rule are tested and the treatment stop when the first rule of the ruleSet allow access

The configuration shall be (alcoolaw.yml):

And then the code :

Example with rules root directory passed to Abac class. This feature allow to give a policy definition rules directory path directly to the Abac class without adding to all files :

Considering we have 3 yaml files :

The php code can be :

Contribute

If you want to contribute, don't hesitate to fork the library and submit Pull Requests.

You can also report issues, suggest enhancements, feel free to give advices and your feedback about this library.

It's not finished yet, there's still a lot of features to implement to make it better. If you want to be a part of this library improvement, let us know !

See also


All versions of php-abac with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
psr/cache Version ~1.0
symfony/config Version ~3.0|^4.0
symfony/yaml Version ~3.0|^4.0
friendsofphp/php-cs-fixer Version ^2.12
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 craftcamp/php-abac contains the following files

Loading the files please wait ....