D
D
des1roer2015-04-06 16:49:39
Yii
des1roer, 2015-04-06 16:49:39

Yii how to check page availability?

Let's assume each user has a role. Roles correspond to page IDs. For external links, I made such a check (loaded into a frame). Before loading, I look at the haspage table (pivot table - role id, page id) record and, depending on this, I display it or not. But for internal links, I store a relative path like (site\index, page\admin) and so on. Would you like to make a blockpost.php thread so that when a request is made to any page, the role is checked, does it have rights to display?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vit, 2015-04-06
@fornit1917

So make a filter. Well, or in the beforeAction of the parent controller.

D
des1roer, 2015-04-08
@des1roer

and if 20 roles? with an indication of available links in each role? prescribe each? there was an idea to frame the content of the page generated by Yii but without a header and footer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question