2

I am trying to use yii2-user and yii2-admin for my yii2 project.

If I use this configuration in my composer

    "dektrium/yii2-user": "0.9.*@dev", 
    "mdmsoft/yii2-admin": "~2.0",

I get errors in admin module. They are simply not compatible. One error was that yii2 user does not have the status column in the user table. It used to work with this configuration.

    "dektrium/yii2-user": "0.9.*@dev", 
    "mdmsoft/yii2-admin": "*",

However I found that from recently the composer updates for this setting results in a memory error. Even if it does succeed it takes a little less than forever to complete. Can someone tell me if there are stable compatible versions for both these packages? Can you also suggest other modules which we can use for user and rights configuration? thanks

Harlan Gray
  • 341
  • 6
  • 20
  • 2
    you have to consider the fact that they are two extension independent of each other , produced by indipendent part, and therefore do not share (necessarily) features Included and configurations. – ScaisEdge Dec 02 '16 at 07:23
  • 1
    Which dependency requirements make them incompatible? – Mr Goobri Jan 28 '17 at 21:54
  • use -> composer require --ignore-platform-reqs dektrium/yii2-user – Ankur Soni Feb 22 '17 at 07:01

2 Answers2

3

It appears to me your mixing extensions.

Try dektrium/yii2-rbac instead of mdmsoft/yii2-admin,

Per the dektrium/yii2-rbac docs:

Integrated with Yii2-user - flexible user management module

  1. https://github.com/dektrium/yii2-rbac
  2. https://github.com/dektrium/yii2-user
Jairus
  • 816
  • 8
  • 27
  • Thanks. Will give it a go. – Harlan Gray Aug 09 '17 at 12:44
  • If you designing for an intranet and have an Active Directory then I would suggest using the mdmsoft/yii2-admin for managing permissions and the edvlerblog/yii2-adldap-module for a SOS (single sign on) solution. – Jairus Aug 09 '17 at 17:16
  • Ok I finally installed it and trying to use it. They seem to work well together. But how do I add a route and give a role permission to the route? Also I cannot create a menu like with mdmsoft/yii2-admin. Thanks – Harlan Gray Sep 27 '17 at 06:38
  • Per the extension documentation at https://github.com/dektrium/yii2-rbac "Allows CRUD operations for auth items (roles and permissions) and rules." Routes do not appear to be an option with this extension. I personally use mdmsoft/yii2-admin for the simplicity. Since the extension includes routes, you don't need to wrap functions around pages with yii:$app->user->can('some_permission") or apply the controller rules. – Jairus Sep 27 '17 at 20:15
  • Have you considered emailing the author and how they handle route management? – Jairus Sep 27 '17 at 20:32
0

Sjaakp/yii2-pluto works fine for me using Yii2 version 2.0.26 and PHP 7.3.5. RBAC. Yii2-advanced template.

Some minor issues with grid icons which are documented on GitHub.

However it appears not to use routes. I prefer using the can function.

Addi
  • 199
  • 14