public function assign(array $items): bool
    {
        foreach ($items as $name) {
            $item = $this->manager->getRole($name);
            $item = $item ?: $this->manager->getPermission($name);
            $this->manager->assign($item, $this->userId);
        }

        return true;
    }
public function assign(array $items): bool
    {
        foreach ($items as $name) {
            $item = $this->manager->getRole($name);
            $item = $item ?: $this->manager->getPermission($name);
            $this->manager->assign($item, $this->userId);
        }

        return true;
    }
public function assign ( array $ items ) : bool { foreach ( $ items as $ name ) { $ item = $ this -> manager -> getRole ( $ name ) ; $ item = $ item ? : $ this -> manager -> getPermission ( $ name ) ; $ this -> manager -> assign ( $ item , $ this -> userId ) ; } return true ; }
Assign a roles and permissions to the user.

@param array $items

@return bool
Assign a roles and permissions to the user .