I am developing a demo project using YII to learn it.
My doubt is on accessRules() function.
In my project to check the user access(For registered users), I am keeping a value in a session on user login and i'm checking the user access using 'expression' context parameter in accessRules.
Something like:
array('allow',
'actions'=>array('create','edit','delete'),
'expression' => '$this->isUser()' //isUser() returns bool value by checking session.
),
For this same functionality i like to use 'users' context parameter. But i am unable to understand how '@' is referring Authenticated Users.
Please let me know
What are you using to detect that the user is logged in? A simple session variable set manually by yourself?
I suggest you take a look here to read about login for Yii:
http://www.yiiframework.com/doc/guide/1.1/en/topics.auth
And for a example that already has login system implemented you could take a look at the blog demo that comes with the download of the framework in the demos folder. If you check one by one the files that are being used in the login process you could easily copy them and integrate them into your project. (like; sitecontroller/login action, loginform, useridentity component, and so on).
The '@' symbol is representing a logged in user and '*' means all users.
So I know that in the 'users' key of the array I can put one of this values:
Other resource that might be useful:
http://www.larryullman.com/2010/01/04/simple-authentication-with-the-yii-framework/