Help With Rights

Hello,

I have successfully setup User and Rights extension and configured my main.php to use both.

I can create roles and assign permissions to roles for controller actions through the Rights web interface.

However, these assignment do not apply and logged in users can access everything. What else do I need to do in order to make the assignments affect my web app?

How do I specify business rules through Rights so for example the logged in user can only access his items etc?

Unfortunately the available topics and Yii documentation is not clear enough and couldn’t find an easy to follow solution for this simple task.

Hi please try auth extension

thank you for your suggestion.

I tried to change to auth, after setting it up when navigating to index.php?r=auth I get the following error:

Alias "bootstrap.widgets.TbGridView" is invalid. Make sure it points to an existing directory or file.

Please note that I am not using the bootstrap extension and I do not plan to use for now.

What might be the problem?

Looks like that Bootstrap is required for Auth.

Installing Bootstrap solved the problem above.

Does anyone know how to get the roles of the logged in user?

In Rights you could do that using


$roles=Rights::getAssignedRoles(Yii::app()->user->Id);