public function init() { //'itemTable'=>'AuthItem', //'itemChildTable'=>'AuthItemChild', $this->assignmentTable = Campaign::getId() . '_AuthAssignment'; parent::init(); }
public function init() { parent::init(); //Turn on error reporting for bizRule if debug mode $this->showErrors = YII_DEBUG; //Load default roles which are dynamic roles in the system $roleItems = $this->getAuthItems(self::ROLE_ITEM_TYPE); foreach ($roleItems as $role) { if (!empty($role->bizRule)) { $this->defaultRoles[] = $role->name; } } }
public function init() { // Run the parent parent::init(); // Run only if we are not guests if (!Yii::app()->user->isGuest) { // Assign a role to the member only if we didn't assign one yet if (!$this->isAssigned(Yii::app()->user->role, Yii::app()->user->id)) { if ($this->assign(Yii::app()->user->role, Yii::app()->user->id)) { $this->save(); } } } }