Hi,
I’m using Yii framework, and CDbAuthManager class for authorization users. For check one access can use this code:
Yii::app()->user->checkAccess('post');
This code execute a db query, It’s here in background:
SELECT * FROM `auth_item` WHERE name='post'
Now If I check other access, then execute another db query:
Yii::app()->user->checkAccess('comment');
SELECT * FROM `auth_item` WHERE name='comment'
Now if I need to check many of access, so execute many db query. Now, how can I check multi access, So that just execute single query db. For example I wish have a code be like this:
Yii::app()->user->checkAccess(array('post', 'comment'));
And maybe execute be like this query for that:
SELECT * FROM `auth_item` WHERE name IN ('post', 'comment');
Any idea?!