User Access

Hi,

Am using RBAC for the user role. In my auth_assignment table, I have Manager and SuperAdmin in the item_name7014

auth_assignment.PNG

The issue is that when I log in as manager, it suppose to display data for that manager alone, building that belong to that manager alone. But its displaying all the managers and buildings. See the tables below:

7015

auth_item_child.PNG

7016

manager.PNG

7017

application.PNG

Please help me out.

This might help you: http://www.yiiframework.com/doc-2.0/guide-security-authorization.html#using-rules

Then you need to pass this manager’s ID to the query criteria. It has nothing to do with RBAC.

Please how do I go about this




$post = Post::findOne(['id' => $id, 'created_by' => Yii:$app->user->ID]);