예제 #1
0
파일: Guest.php 프로젝트: psesd/chms-common
 /**
  * @inheritdoc
  */
 public function getRoles()
 {
     if (!isset($this->roles)) {
         $this->roles = parent::getRoles();
         $this->roles->add('guest');
     }
     return clone $this->roles;
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function getRoles()
 {
     if (!isset($this->roles)) {
         $this->roles = parent::getRoles();
         $roles = $this->getRoleQuery()->pluck('role_id');
         foreach ($roles as $role) {
             if ($role = app(RoleProvider::class)->getRoleById($role)) {
                 $this->roles->add($role['system_id']);
             }
         }
     }
     return clone $this->roles;
 }
예제 #3
0
 /**
  * @inheritdoc
  */
 public function getRoles()
 {
     if (!isset($this->roles)) {
         $this->roles = parent::getRoles();
         if ($this->subjectObject->type === ClientModel::TYPE_CENTRAL_HUB) {
             $this->roles->add('client_central_hub');
         } elseif ($this->subjectObject->type === ClientModel::TYPE_PROVIDER) {
             $this->roles->add('client_provider');
         } elseif ($this->subjectObject->type === ClientModel::TYPE_PROVIDER_HUB) {
             $this->roles->add('client_provider_hub');
         } elseif ($this->subjectObject->type === ClientModel::TYPE_CLIENT) {
             $this->roles->add('client_client');
         }
     }
     return clone $this->roles;
 }