The situation is this, you need to do so!

  1. There is a manager_1 he has his users and he sees only their posts!
  2. There is a manager_2 he has his users and he sees only their posts!
  3. There is a manager_3 he has his users and he sees only their posts!

Etc. I guess this is a user group! maybe wrong. Tell me where to read about rbac, I can not figure out how to make this structure through it. Thank.

  • What is meant by the word "sees"? If you only see, then an ordinary query with INNER JOIN - robertobadjio 2:49 pm
  • If you need groups of users, read the YII2 RBAC documentation and do it by analogy - robertobadjio

1 answer 1

RBAC allows you to configure roles and permissions. Permissions are given to specific sections of the site, for example, site / user, site / post, etc. Permissions are grouped into roles for convenience. Therefore, RBAC, as I understand it, is not very suitable for your purpose. You probably need to create your own system of rights. Add an author tag to the article, for example, a column with an ID. And then choose the article, depending on which manager views the list of articles. There should also be a table of users, user groups and a transition table for many-to-many communications (groups and users)