Download the PHP package mimmi20/mezzio-generic-authorization-acl without Composer

On this page you can find all versions of the php package mimmi20/mezzio-generic-authorization-acl. 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 mezzio-generic-authorization-acl

mezzio-generic-authorization-acl

Latest Stable Version Latest Unstable Version License

Code Status

codecov Test Coverage Average time to resolve an issue Percentage of issues still open Mutation testing badge Maintainability

Installation

You can install the mezzio-generic-authorization-acl library with Composer:

Introduction

This component provides Access Control List (ACL) authorization abstraction for the mezzio-generic-authorization library.

ACLs are based around the idea of resources and roles:

Put simply, roles request access to resources. For example, if a parking attendant requests access to a car, then the parking attendant is the requesting role, and the car is the resource, since access to the car may not be granted to everyone.

Through the specification and use of an ACL, an application may control how roles are granted access to resources. For instance, in a web application a resource can be a page, a portion of a view, a route, etc. A role can vary based on the context in which the request is made: it could be the client identity sent with an API request; whether the users is an anonymous guest or a registered user of the site; etc.

Configure an ACL system

You can provide your ACL definitions using a configuration file, as follows:

We use this same example in the documentation of mezzio-authorization-rbac, so that you can compare and contrast the two systems.

The above configuration defines three roles for a blog web site: an editor, a contributor, and an administrator. The contributor role has the editor role as a child role, meaning it inherits its capabilities. The administrator role has the contributor role as a child, inheriting both its direct capabilities, as well as any that role has inherited.

In ACL systems, parent roles inherit the permissions of their children.

Within mezzio-authorization-acl, resources are mapped to the route name currently being requested. By default, all resources are denied access, unless otherwise stated. In our example, we allow the route admin.settings for the administrator, the routes admin.dashboard and admin.posts for the contributor, and the route admin.publish for the editor. Because the contributor inherits permissions from editor, they will also have access to the admin.publish route. Because the administrator inherits permissions from contributor, they will have access to all routes.

You can also deny a resource using the deny key in the configuration file. For instance, you can deny access to the route admin.dashboard by the administrator by adding the following configuration in the previous example:

The usage of allow and deny can help to configure complex permission scenarios, including or excluding specific authorizations.

As noted earlier, mezzio-authorization-acl uses the current route name to determine the resource. If you want to change the permissions type and the logic for authorization, you will need to provide a custom implementation of Mezzio\Authorization\AuthorizationInterface.

mezzio-authorization-acl uses laminas-permissions-acl to implement its ACL system. For more information, we suggest reading the laminas-acl documentation.

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.


All versions of mezzio-generic-authorization-acl with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
laminas/laminas-permissions-acl Version ^2.16.0
mimmi20/mezzio-generic-authorization Version ^3.0.4
psr/container Version ^1.1.2 || ^2.0.2
psr/http-message Version ^1.0.1 || ^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 mimmi20/mezzio-generic-authorization-acl contains the following files

Loading the files please wait ....