Complete module for managing users, they premissions, tasks and roles
Manage users. Can create, update, assign roles and allowed tasks
Manage roles. Can assign allowed tasks to role, can set home page for role (for redirect after login or registration)
Manage tasks (allowed routes).
Built-in login and registration system
Thanks, man! That’s a thing which replaced yiiuser+Rights for me.
I don’t think you need to add a profile like one in yii-user(just take a look if you haven’t yet) - it’s monstrous, like it should be if you want your product to fit all sizes^Wusers. One can add a profile according to his style.
But a thing I need - check if user can access specific page(e.g. in menu creating to show only links he can access), and you have this code as a private method in controller class.
Wouldn’t it be better to put some method UWebUser::accessRoutes() which return all allowed routes and a UWebUser::canAccess($route), which can be used in UAccessController::_isRouteAllowed() to check if specific route is accessible? It’s just about code architecture.
And yes, I can modify classes for my very own requests but someone else will need this someday perhaps.
p.s.: nice code style, easy-to-read-and-understand, thanks again.
This is just an example of how do I use it:
These both are your code, I’ve just moved methods metioned in a prev post .
I have only ONE question?! Is there any real reason of re-inventing wheel?! Yii already has RBAC, and at first sight yii’s version is much more flexible. I just puzzled…why you did it?!
It has just no any advantage. All that you need - add GUI for built-in RBAC or get extension that is doing it for you.
Replacing built-in RBAC with something that looks same and more hardcoded is very bad idea, for any real project. As for learning purposes and hobby - fine.