Comments (9)
I'm using the ConfigAggregator in an expressive application, works out of the box.
$configManager = new ConfigAggregator([
...,
\ZfcRbac\ModuleConfig::class,
new PhpFileProvider($globPattern),
], \sprintf('data/cache/config-%s.php', APP_ENV));
return $configManager->getMergedConfig();
// config/autoload/zfc-rbac.global.php
return [
'dependencies' => [
'factories' => [
\ZfcRbac\Role\RoleProviderInterface::class => \ZfcRbac\Container\InMemoryRoleProviderFactory::class,
],
],
'zfc_rbac' => [
'role_provider' => [
InMemoryRoleProvider::class => [
],
],
'assertion_map' => [
],
],
];
For zf3 you should only have to change dependencies
to service_manager
I guess.
from zfc-rbac.
I am just thinking what people will do with something other than Zend\ServiceManager how hard would be with Symfony or Laravel?
and 'dependencies' => [...
thing is zend-expressive specific so maybe we should load this config after install as other repressive modules do through expressive installer like this: https://github.com/svycka/swagger-middleware/blob/master/composer.json#L60-L63
from zfc-rbac.
I am just thinking what people will do with something other than Zend\ServiceManager how hard would be with Symfony or Laravel?
About decoupling from zf service manager: problem might be that we use the plugin manager for assertion plugins. Then again a plugin manager is just a nested container in theory.
I don't know how symfony or laravel does this and how it would impact "modules" such as this one... If you think we can support them easily I see no reason why not to do it.
and
'dependencies' => [...
thing is zend-expressive specific so maybe we should load this config after install as other repressive modules do through expressive installer like this: https://github.com/svycka/swagger-middleware/blob/master/composer.json#L60-L63
yes, i agree we should do that
from zfc-rbac.
About decoupling from zf service manager: problem might be that we use the plugin manager for assertion plugins. Then again a plugin manager is just a nested container in theory.
It's already done we only use ZF service manager internally for assertions, but config files are structured for ZF service manager but that's the only thing what stops from using something else. We can change the configuration to whatever we need. All factories use PSR-11 and could be used with any PSR-11 implementation as I understand.
But I do not have much experience with Laravel or Symfony maybe there is problems I don't know :)
from zfc-rbac.
As far as I know there are no plugin managers (like in ZF) available in symfony or laravel.
from zfc-rbac.
@prolic we don't need a plugin manager any PSR-11 implementation is good to go as we only use $container->get('something')
. Okay, maybe only config or custom setup required for PSR-11 container and not sure but maybe one or two factories will have to be changed but that's it. Maybe would be better to create few separate projects making as modules for laravel or symfony
from zfc-rbac.
Not that bad but still maybe someone can suggest something better? Maybe we should support ZF and expressive by default since we have everything ready for them? And also not existing documentation.
I would like to test the 3.0.0-alpha.1 release with my expressive application. Beside the config aggregator, which additional steps I need to call the ZfcRbac Authorization from pipeline or route?
Thanks in advance.
from zfc-rbac.
@imonteiro that's for you to decide. you only need to have an identity. Basically, this lib has only one method $authorization->isGranted($identity, 'permission')
it no longer has guards as in 2.x version like RouteGuard
, of course, you can easily implement yourself.
from zfc-rbac.
@svycka I get it. Thanks 👍
from zfc-rbac.
Related Issues (20)
- Tag stable version for ZF3 compat HOT 6
- Looking for a new maintainer(s) HOT 5
- Missing use statement in ZfcRbac\Initializer\AuthorizationServiceInitializer HOT 1
- RedirectStrategy doesn't work with "ZF3" Eventmanager HOT 8
- RedirectStrategy + zf3 HOT 8
- Future HOT 23
- Very strange session regeneration issue when using ZfcUser with ZfcRbac HOT 3
- Fllow the cookbook I get a problem not fund the authorizationservice HOT 3
- Unable to resolve service "Zend\Authentication\AuthenticationService
- why i always get error flow the cookbook? i will show what happend with my application HOT 4
- Cannot get a name and parameters for RoleProviderPluginManager HOT 2
- a guard priority question HOT 1
- Is there Mechanism of a cache? HOT 1
- Problem with doctrine update
- What is the plan of 3.0 release? HOT 7
- Maybe we could have PermissionProvider?
- HierarchicalRoleInterface problem HOT 1
- Migrate to Laminas HOT 7
- Is there a migration to Laminas either on-going or planned?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zfc-rbac.