Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function mayGenerally($model_object, $action) {
- $user = self::getUser();
- $model_class = get_class($model_object);
- $authItem = self::createAuthItem($action, 'any', $model_class);
- if ($model_object->autoAuthItemMatch == false) {
- $accessRules = $model_object->accessRules();
- $autItem = $accessRules[$action][$model_object->accessTerms['generalAccessTerm']];
- //this part here is defined by the user in a model in a method called accessRules()
- //what would be the best checking method if the array has been set at all
- }
- if ($user->profile->branch_id == Branch::ROOT_BRANCH && Yii::app()->user->checkAccess($authItem))
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement