yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Structure proposal

Open Eseperio opened this issue 7 years ago • 7 comments

@maxxer @tonydspaniard

Since i´m developing the gdpr support, one thing came to mind.
User management is a system that can be so complex and extended in many many ways.

I thought if we use enough events and content blocks we can make yii2-usuario extendable, and things like privacy management (gdpr) could be a single package.

The idea is add events in almost every method and blocks

That way you can install basic user management: yii2-usuario and rbac, and after that access to custom or public extensions for this module.

Modules like: Avatar management Privacy User documents ...

What do you think about? may it be worth?

Eseperio avatar Sep 12 '18 08:09 Eseperio

@maxxer @Eseperio That was an idea that came to my mind when I first started creating the module. Then, due to my constant stress of work I couldn't get back to it again. For example, the TwoAuth option is a clear example of an extension where we should not force people to have it.

I really like the idea, but I am not sure how those extensions should be injected as they must have some strict API (like facades or bundles on other frameworks), that also implements its own set of views that should be able to be overriden too.

The Module class is already too bloated with far too many configuration options. I think this proposal just comes right at time.

I am up for it...

tonydspaniard avatar Sep 12 '18 08:09 tonydspaniard

I was thinking in having a module with its own controllers and views that includes a special file called events.php where all logic is attached to yii2-usuario. It is like an events adapter. That way any extension can be used with other libraries using a custom event adapter.
In case of views it could be good to get via module the pre-defined paths to yii2-usuario shared views, so any extension can implement them in their views.

The result is two individual modules that can work seamless via events, like behaviors to models.

Eseperio avatar Sep 12 '18 09:09 Eseperio

Please, allow me to think about it carefully, I may come up with an extension manager for the module and its bootstrap process. So, we could easily attach extensions to it.

In the meantime, feel free to make a proof of concept so we can brainstorm.

tonydspaniard avatar Sep 12 '18 13:09 tonydspaniard

So we need:

  • [ ] Field injection
  • [ ] Events on each action step.
  • [ ] Allow dependencies on other extensions, so they can load after dependencies
  • [ ] Allow code injection at bootstrap class.
  • [ ] Easy reusable views (use of blocks, widgets and layouts)
  • [ ] Links injection on shared menus.
  • [ ] Integration system (a forced procedure to implement all the above, whatever the extension is).

Eseperio avatar Sep 16 '18 15:09 Eseperio

So... This extension will be named yii2-usuario-gdpr yii2-usuario-2fa yii2-usuario-recaptcha etc..

bscheshirwork avatar Sep 18 '18 08:09 bscheshirwork

@Eseperio right, I would include:

  • [ ] Integration system (a forced procedure to implement all the above, whatever the extension is). That way we will reinforce code quality - i.e. bundles, facades as examples.

tonydspaniard avatar Sep 19 '18 19:09 tonydspaniard

Already started splitting packages on a different branch #323

tonydspaniard avatar Jun 29 '19 06:06 tonydspaniard