@goplusvn/core 0.1.81 → 0.1.83

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@goplusvn/core",
3
3
  "description": "GoPlusVN Platform Kit - ERP kernel: layout, RBAC, CRUD, multi-tenant, system pages",
4
- "version": "0.1.81",
4
+ "version": "0.1.83",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org",
@@ -121,19 +121,17 @@ export function assertWorkspacesInScope(
121
121
  requestedWorkspaceIds: readonly string[],
122
122
  ): void {
123
123
  if (actor.canManageAll) return;
124
- if (actor.scope.adminIds.length === 0) {
125
- throw new DelegationError(
126
- "NO_DELEGATION",
127
- "Bạn không được uỷ quyền quản trị workspace nào.",
128
- );
129
- }
124
+
125
+ // [MODIFIED] Relaxed rule: allow users to operate in workspaces they are members of,
126
+ // without requiring explicit 'admin' privileges over them.
130
127
  const outside = requestedWorkspaceIds.filter(
131
- (id) => !isWorkspaceAdmin(actor.scope, id),
128
+ (id) => !isWorkspaceAdmin(actor.scope, id) && !actor.scope.rootIds.includes(id),
132
129
  );
130
+
133
131
  if (outside.length > 0) {
134
132
  throw new DelegationError(
135
133
  "D1_OUT_OF_SCOPE",
136
- `Ngoài phạm vi quản trị của bạn: ${outside.join(", ")}.`,
134
+ `Ngoài phạm vi của bạn: ${outside.join(", ")}. Bạn phải là thành viên hoặc quản trị viên của đơn vị này.`,
137
135
  );
138
136
  }
139
137
  }