N
N
Nikolay Kaspor2018-05-13 17:58:57
Yii
Nikolay Kaspor, 2018-05-13 17:58:57

How to generate a query in Yii2?

There is an article in the database, only the creator has access to it. That is, if you open a list of articles, then a person will see only his articles. In order to give access to the article, I created a new table in which I specify the user ID and article ID. How now to make a person see all the articles that he created and to which he was given access?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2018-05-13
@BorisKorobkov

join tables with rights and condition by user ID
PS I recommend not to reinvent the wheel, but to use RBAC. For example, https://github.com/dektrium/yii2-user

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question