Download the PHP package delboy1978uk/bone-passport without Composer
On this page you can find all versions of the php package delboy1978uk/bone-passport. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download delboy1978uk/bone-passport
More information about delboy1978uk/bone-passport
Files in delboy1978uk/bone-passport
Package bone-passport
Short Description ACL package for Bone Framework
License MIT
Informations about the package bone-passport
bone-passport
Passport package for Bone Mvc Framework
installation
Use Composer
usage
Simply add to the config/packages.php
Now run the bone command to pick up database changes, creating a database migration, then run them:
roles
Roles can be set via the command line using the bone
command
You can assign a role to a user again by using the bone
command
middleware
Bone Passport comes with an easy to use middleware to secure your routes. Anyone without the required credentionals will receive a 403 unauthorised response.
In your addRoutes()
method in the package class, create the middleware first:
To secure an endpoint, you should already be using a middleware such as SessionAuth
, which provides a PSR-7
RequestInterface with a User object set as the user
attribute. Add to the array of middlware with the options you
require:
entity ids
Sometimes a role will only be in control of various specific entities. For example, a league admin would be in charge of specific clubs in that league. Usually the ID of that entity will be in the URL. You can lock down this by passing the route variable name, like so:
All versions of bone-passport with dependencies
delboy1978uk/barnacle Version ^2.2
delboy1978uk/bone-doctrine Version ^1.1
delboy1978uk/passport Version *