Example #1
0
 protected static function setDefaultRoles($user_id)
 {
     self::$defaultRoles = $user_id ? AuthItemChild::childList(self::ROLE_DEFAULT) : AuthItemChild::childList(self::ROLE_GUEST);
     self::$defaultRoles = Yii::$app->authManager->defaultRoles = array_merge(Yii::$app->authManager->defaultRoles, self::$defaultRoles);
 }