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

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

mezzio-generic-authorization

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 library with Composer:

Introduction

This component provides middleware for Mezzio and PSR-7 applications for authorizing specific routes based on ACL or RBAC systems.

Unlike in mezzio-authorization this library does not require the ServerRequestInterface by default. This makes it possible to use this component in combination with mezzio-navigation.

If you are using the provided midleware, the route name is used as the resource.

An authorization system first needs authentication: to verify that an identity has access to something (i.e., is authorized) we first need the identity, which is provided during authentication.

Authentication is provided via the package mezzio-authentication. That library provides an AuthenticationMiddleware class that verify credentials using the HTTP request, and stores the identity via a PSR-7 request attribute.

The identity generated by mezzio-authentication is stored as the request attribute Mezzio\Authentication\UserInterface as a UserInterface implementation. That interface looks like the following:

mezzio-generic-authorization consumes this identity attribute. It checks if a user's role (as retrieved from the UserInterface object) is authorized (granted) to the perform the current HTTP request.

Authorization is performed using the isGranted() method of the AuthorizationInterface

Two adapters are available:

If you want to know more about authentication using middleware in PHP, we suggest reading the blog post "Authorize users using Middleware".

Authorization adapters

You can configure the authorization adapter to use via your service container configuration. Specifically, you can either map the service name Mimmi20\Mezzio\GenericAuthorization\AuthorizationInterface to a factory, or alias it to the appropriate service.

For instance, using Mezzio container configuration, you could select the mezzio-authorization-acl adapter in either of the following ways:

We provide two different adapters.

Each adapter is installable via Composer:

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.


All versions of mezzio-generic-authorization with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
mezzio/mezzio-authentication Version ^1.9.0
mezzio/mezzio-router Version ^3.17.0
psr/container Version ^1.1.2 || ^2.0.2
psr/http-factory Version ^1.1.0
psr/http-message Version ^1.0.1 || ^2.0
psr/http-server-handler Version ^1.0.2
psr/http-server-middleware Version ^1.0.2
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 contains the following files

Loading the files please wait ....