diff --git a/composer.json b/composer.json index 5772287..c0366b5 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "mcnd/taxus", "description": "A simple privilege library to handle an application's permissions.", - "keywords": ["mcnd","privilege","permission","taxus"], + "keywords": [ + "mcnd", + "privilege", + "permission", + "taxus" + ], "license": "MIT", "authors": [ { @@ -13,5 +18,14 @@ "psr-4": { "Taxus\\": "src/" } + }, + "extra": { + "lean": { + "autoload": { + "definitions": [ + "meta/definitions.php" + ] + } + } } -} +} \ No newline at end of file diff --git a/meta/definitions.php b/meta/definitions.php new file mode 100644 index 0000000..74a1354 --- /dev/null +++ b/meta/definitions.php @@ -0,0 +1,22 @@ + function ($c) { + $taxus = new Taxus( $c->get(PermissionGrantInterface::class) ); + + $taxus->add(... $c->get(Lean\Lean::class)->getTaxusPrivileges()); + + return $taxus; + }, + + PermissionGrantInterface::class => create(PermissionGrantInterface::class)->constructor(get(ServerRequestInterface::class), get(Session::class)), +]; \ No newline at end of file