/** * {@inheritDoc} * @see IPluggableAccessManager::getAuthAssignments() */ public function getAuthAssignments(IPluggableModule $module, IPluggableUserProfile $profile) { $criteria = new CDbCriteria(); $criteria->with = array('accessRole' => array('alias' => 'r')); $criteria->compare('r.module_name', $module->getId()); $criteria->compare('user_profile_id', $profile->getId()); return AccessAssignment::model()->findAll($criteria); }
/** * {@inheritDoc} * @see IPluggableAccessManager::getAuthAssignments() */ public function getAuthAssignments(IPluggableModule $module, IPluggableUserProfile $profile) { $assignments = $this->_manager->getAuthAssignments($profile->getId()); $auths = array(); foreach ($assignments as $assignment) { /* @var $assignment CAuthAssignment */ $role = $this->getAuthItem($module, $assignment->itemName); if ($role !== null) { $auths[] = new PluggableAccessAssignment($profile, $role, $assignment->bizRule, $assignment->data); } } return $auths; }