Download the PHP package arc/grants without Composer

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

arc/grants: access control management

Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

A flexible component library for PHP


The Ariadne Component Library is a spinoff from the Ariadne Web Application Framework and Content Management System [ http://www.ariadne-cms.org/ ]

How it works

arc/grants is a simple and extensible system to manage access in a hierarchical system like a filesystem. At each node in the tree you can assign access grants for a specific user or group. There are no predefined grants, a grant can be any word. e.g.

This assigns the grant 'read' for the user 'public' on the path '/foo/'. This grant is automatically set for any path under '/foo/' as well. e.g:

You can assign multiple grants as a space-seperated string:

Grants for users do not stack. If you assign grants for a user somewhere, those will be the only grants available starting at that node. Previous grants are overwritten. If you want to revoke grants, simply set the grants again, without the grant you want revoked. To revoke all grants, set a 'marker' grant that is never checked, e.g:

The grants string is a simple DSL (Domain Specific Language) that allows you to set grants that do not 'trickle down' or to set grants that only apply on child nodes:

Default user and path

You can assign a default user for the grants system to use:

Then you can assign grants and check them, without specifying the user:

If you don't set a specific path with the cd() method, grants will be set and checked for the 'default' path. This is the path that is last set using \arc\grants::cd( $path ), e.g.:

This checks the grants for user 'admin' at '/foo/'. Any subsequent calls to \arc\grants assume this is the user and path you want to use. Untill you again call either cd() or switchUser() on the \arc\grants class (statically).

Groups

If a user is member of one or more groups, you can set it like this:

And check it like this:

Group grants are added to any user grants previously set. If you set user grants at a node, any group grants set at parent nodes are ignored. Only group grants under that node are added to the user grants.

If you override grants for a specific group, only the later group grants are applied, but only for that specific group.

Because mike has the 'edit' grant on '/', the group grants cannot remove it, so this works:

Because the group 'editors' grants with 'read add edit >delete' are set at the same node as Mike's personal grants, they are overruled by Mike's personal more restrictive grants, so this returns false:

Finally the group grants for 'editors' is overridden at '/foo/', so this also returns false:

Listing grants

This will return a list of all user grants at a specific node. It will only return the grants set at this specific node, not a list of all currently applicable grants:

Both will return an array with the user or group as the key and the grants string as the value or an empty string if no grants are set.

Todo


All versions of grants with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
arc/base Version ~3.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 arc/grants contains the following files

Loading the files please wait ....