- Needs to rework a way to add new privileges
This commit is contained in:
parent
25a8a9e472
commit
972d54bd21
|
@ -9,13 +9,13 @@ use Taxus\{ Privilege, Taxus, PermissionGrantInterface, DefaultPermissionGrant }
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
Taxus::class => function ($c) {
|
Taxus::class => function ($c) {
|
||||||
$taxus = new Taxus( $c->get(PermissionGrantInterface::class) );
|
return ( new Taxus( $c->get(PermissionGrantInterface::class) ) )->add(
|
||||||
|
[ new Privilege("dev", "Is a developper of this application."), "is_dev" ],
|
||||||
$taxus->add(... $c->get(Lean\Lean::class)->getTaxusPrivileges());
|
[ new Privilege("admin", "Can manage mostly everything from this application."), "is_admin" ],
|
||||||
|
[ new Privilege("user", "Is an authenticated user."), "is_user" ],
|
||||||
return $taxus;
|
[ new Privilege("anonymous", "Is an anonymous (unauthenticated) user."), "is_anonymous" ],
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
PermissionGrantInterface::class => create(PermissionGrantInterface::class)->constructor(get(ServerRequestInterface::class), get(Session::class)),
|
PermissionGrantInterface::class => create(PermissionGrantInterface::class)->constructor(get(ServerRequestInterface::class), get(Session::class)),
|
||||||
|
|
Loading…
Reference in New Issue