- 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;
|
||||
|
||||
return [
|
||||
|
||||
Taxus::class => function ($c) {
|
||||
$taxus = new Taxus( $c->get(PermissionGrantInterface::class) );
|
||||
|
||||
$taxus->add(... $c->get(Lean\Lean::class)->getTaxusPrivileges());
|
||||
|
||||
return $taxus;
|
||||
return ( new Taxus( $c->get(PermissionGrantInterface::class) ) )->add(
|
||||
[ new Privilege("dev", "Is a developper of this application."), "is_dev" ],
|
||||
[ new Privilege("admin", "Can manage mostly everything from this application."), "is_admin" ],
|
||||
[ new Privilege("user", "Is an authenticated user."), "is_user" ],
|
||||
[ new Privilege("anonymous", "Is an anonymous (unauthenticated) user."), "is_anonymous" ],
|
||||
);
|
||||
},
|
||||
|
||||
PermissionGrantInterface::class => create(PermissionGrantInterface::class)->constructor(get(ServerRequestInterface::class), get(Session::class)),
|
||||
|
|
Loading…
Reference in New Issue