@agenticmail/enterprise 0.5.303 → 0.5.304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,6 +135,8 @@ function PermissionEditor({ userId, userName, currentPerms, pageRegistry, onSave
135
135
  }
136
136
  }
137
137
  await onSave(permsToSave);
138
+ // Save org assignment
139
+ await apiCall('/users/' + userId, { method: 'PATCH', body: JSON.stringify({ clientOrgId: userOrgId || null }) }).catch(function() {});
138
140
  } catch(e) { /* handled by parent */ }
139
141
  setSaving(false);
140
142
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.303",
3
+ "version": "0.5.304",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -135,6 +135,8 @@ function PermissionEditor({ userId, userName, currentPerms, pageRegistry, onSave
135
135
  }
136
136
  }
137
137
  await onSave(permsToSave);
138
+ // Save org assignment
139
+ await apiCall('/users/' + userId, { method: 'PATCH', body: JSON.stringify({ clientOrgId: userOrgId || null }) }).catch(function() {});
138
140
  } catch(e) { /* handled by parent */ }
139
141
  setSaving(false);
140
142
  };
@@ -233,6 +235,30 @@ function PermissionEditor({ userId, userName, currentPerms, pageRegistry, onSave
233
235
  })
234
236
  ),
235
237
 
238
+ // ─── Organization Assignment ──────────────────────
239
+ permOrgs.length > 0 && h('div', { style: { marginTop: 16, padding: '12px 14px', background: 'var(--bg-tertiary)', borderRadius: 8 } },
240
+ h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 8 } },
241
+ h('div', null,
242
+ h('strong', { style: { fontSize: 13 } }, 'Client Organization'),
243
+ h('div', { style: { fontSize: 11, color: 'var(--text-muted)', marginTop: 1 } }, 'Bind this user to a client org — they will only see that org\'s agents and data')
244
+ )
245
+ ),
246
+ h('select', {
247
+ className: 'input',
248
+ value: userOrgId,
249
+ onChange: function(e) { setUserOrgId(e.target.value); },
250
+ style: { fontSize: 13 }
251
+ },
252
+ h('option', { value: '' }, 'None (Internal User)'),
253
+ permOrgs.filter(function(o) { return o.is_active !== false; }).map(function(o) {
254
+ return h('option', { key: o.id, value: o.id }, o.name);
255
+ })
256
+ ),
257
+ userOrgId && h('div', { style: { fontSize: 11, color: 'var(--warning, #f59e0b)', marginTop: 6 } },
258
+ 'This user will only see agents and data belonging to this organization. The org switcher will be locked for them.'
259
+ )
260
+ ),
261
+
236
262
  // ─── Agent Access ──────────────────────────
237
263
  !fullAccess && h('div', { style: { marginTop: 16 } },
238
264
  h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 8 } },