Hey,
I’m pretty new to Yii but have a good understanding of the MVC pattern, mainly due to my experience with joomla.
Anyway, some noob questions:
-
I have implemented a basic role access control and managed to restrict access to menu items using accessRules. However, when displaying a list of items in my index view (lets say products) I want the logged in user to only have access to those items that he has uploaded (there is a foreign key connection between product and user). How should I go for this? Is this something we implement with filters? Right now all users are allowed to index all items but not edit them since I managed to restrict editing via the accessRules.
-
I was wondering if there is a way to have a main menu with items retrieved from database defined only once on my main layout. I do understand that layouts inherit from views and that is possible to define the main menu on each controller/view, but is there a way to generate only once the menu for a logged in user and then make my layout to use that one?