- Work done on the kinda-micro-framework to allow smoother deployment
This commit is contained in:
1 parent
f719246624
commit
aba9a65a3c
14 files changed
+357
-12
No files matched your search
@@ -31,6 +31,7 @@ return array_merge(
|
||||
|
||||
require("$dir/auth.php"),
|
||||
require("$dir/storage.php"),
|
||||
require("$dir/security.php"),
|
||||
require("$dir/env/" . getenv('APP_ENV') . ".php"),
|
||||
[ 'config' => function () { return require(getenv("META_PATH")."/config.php"); } ]
|
||||
);
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use function DI\autowire, DI\create, DI\get;
|
||||
|
||||
use Storage\Session;
|
||||
|
||||
use Taxus\{ Privilege, Taxus, PermissionGrantInterface, DefaultPermissionGrant };
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
return [
|
||||
Taxus::class => function ($c) {
|
||||
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(DefaultPermissionGrant::class)->constructor(get(ServerRequestInterface::class), get(Session::class)),
|
||||
];
|
||||
Reference in new issue
Block a user