+ async addUserRow(userId) {
+ const exists = this.userContainer.querySelector(`[name^="permissions[user][${userId}]"]`) !== null;
+ if (exists) {
+ return;
+ }
+
+ const toggle = this.userSelectContainer.querySelector('.dropdown-search-toggle-select');
+ toggle.classList.add('disabled');
+ this.userContainer.style.pointerEvents = 'none';
+
+ // Get and insert new row
+ const resp = await window.$http.get(`/permissions/user-form-row/${this.entityType}/${userId}`);
+ const row = htmlToDom(resp.data);
+ this.userContainer.append(row);
+
+ toggle.classList.remove('disabled');
+ this.userContainer.style.pointerEvents = null;
+
+ /** @var {UserSelect} **/
+ const userSelect = window.$components.firstOnElement(this.userSelectContainer.querySelector('.dropdown-search'), 'user-select');
+ userSelect.reset();
+ }
+