private function assignPermissions(Collection $permissions) {
        $roles = Role::whereIn('id', $this->role_ids)->get();

        if ($roles && $permissions) {
            $permission_ids = $permissions->lists('id')->all();

            foreach ($roles as $role) {
                $role->permissions()->attach($permission_ids);
            }
        }
    }