コード例 #1
0
 public function init()
 {
     //'itemTable'=>'AuthItem',
     //'itemChildTable'=>'AuthItemChild',
     $this->assignmentTable = Campaign::getId() . '_AuthAssignment';
     parent::init();
 }
コード例 #2
0
ファイル: XAuthManager.php プロジェクト: hung5s/yap
 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;
         }
     }
 }
コード例 #3
0
 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();
             }
         }
     }
 }