w-web-perm 1.1.9 → 1.1.11
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/README.md +8 -0
- package/dist/index.tmp +1 -1
- package/dist/js/app-legacy.963e800c.js +1 -0
- package/dist/js/app.963e800c.js +1 -0
- package/dist/js/{chunk-vendors-legacy.da785a99.js → chunk-vendors-legacy.3e9e3ef1.js} +3 -3
- package/dist/js/{chunk-vendors.da785a99.js → chunk-vendors.3e9e3ef1.js} +3 -3
- package/dist/w-web-perm.umd.js +2 -2
- package/dist/w-web-perm.umd.js.map +1 -1
- package/docs/WWebPerm.html +2 -2
- package/docs/global.html +651 -9
- package/docs/index.html +2 -2
- package/docs/server_WWebPerm.mjs.html +23 -3
- package/docs/server_dataChannel.mjs.html +2 -2
- package/docs/server_lockSave.mjs.html +2 -2
- package/docs/server_maskLog.mjs.html +2 -2
- package/docs/server_procCore.mjs.html +28 -12
- package/docs/server_staLogs_resolveShellWorker.mjs.html +2 -2
- package/docs/server_validateRows.mjs.html +17 -16
- package/docs/server_wrapInjected.mjs.html +2 -2
- package/docs/src_fetchJson.mjs.html +2 -2
- package/docs/src_js_eachOwn.mjs.html +119 -0
- package/docs/src_js_getOwn.mjs.html +110 -0
- package/docs/src_js_getRuleEnable.mjs.html +96 -0
- package/docs/src_js_legendFit.mjs.html +2 -2
- package/docs/src_plugins_reuseDeletedIds.mjs.html +2 -2
- package/docs/src_plugins_submitGuard.mjs.html +2 -2
- package/package.json +14 -14
- package/server/WWebPerm.mjs +21 -1
- package/server/procCore.mjs +26 -10
- package/server/validateRows.mjs +15 -14
- package/src/components/LayoutContentGrups.vue +4 -3
- package/src/components/LayoutContentPemis.vue +4 -3
- package/src/components/LayoutContentUsers.vue +2 -1
- package/src/components/VeCgrups.vue +4 -3
- package/src/components/VeCpemis.vue +4 -3
- package/src/components/VeCrules.vue +4 -4
- package/src/components/VeGrupBlngUsers.vue +4 -3
- package/src/components/VePemiBlngGrups.vue +4 -3
- package/src/js/eachOwn.mjs +47 -0
- package/src/js/getOwn.mjs +38 -0
- package/src/js/getRuleEnable.mjs +24 -0
- package/src/perm.mjs +6 -3
- package/src/plugins/mShare.mjs +25 -12
- package/dist/js/app-legacy.ecb7ce08.js +0 -1
- package/dist/js/app.ecb7ce08.js +0 -1
package/README.md
CHANGED
|
@@ -96,6 +96,14 @@ instWWebPerm.on('error', (err) => {
|
|
|
96
96
|
|
|
97
97
|
## Upgrade Notes
|
|
98
98
|
|
|
99
|
+
### Unreleased: objects carrying a numeric `length` key, and non-array `rows` (2026-10-20)
|
|
100
|
+
- **`rows` must be an array (behavior change)**: `updateTargets`, `updatePemis`, `updateGrups` and `updateUsers` now reject a `rows` argument that is not an array (a string, number, `null`, `undefined`, a plain object, or an object carrying a numeric `length` key), or whose elements are not non-empty objects (`[null]`, `[{}]`, `[""]`, `[[]]`), with `saveRowFieldInvalid` and leave the table unchanged. Previously such input was treated as an empty table: the whole table was cleared and the call reported success (in the `modeEditUsers: 'for:grups'` mode it was silently ignored). An empty array `[]` is still accepted (it clears the table). The bundled front end and `/syncAndReplaceTabs` (which already required a non-empty array) are not affected.
|
|
101
|
+
- **Objects are iterated by their own keys**: a field or key named `length` is an ordinary key everywhere user-supplied objects are walked (write validation, the `cgrups` / `cpemis` / `crules` JSON strings evaluated by `getPerm` / `getPermUserInfor`, and the list pages). Before, lodash treated such an object as an array-like of that length: real keys were skipped (for example a group listed next to `"length": 0` was ignored, so its rules evaluated to `n`) and a huge `length` made the call spin or run out of memory.
|
|
102
|
+
- **`/syncAndReplaceTabs` rows must be non-empty objects (behavior change)**: every element of `rows` must be an object with at least one key. A push containing a string, number, `null`, array, boolean or an empty object `{}` is rejected as a whole with `invalidRows` before anything is deleted. Before, a non-object element made the call fail with an engine message (for example `Cannot create property 'from' on string 'abc'`) that was returned to the application, and an empty object in a multi-row push was written as a blank row with a generated id. A row that carries no schema field at all (for example `{"foo":1}`; it would map to an all-empty row) is rejected the same way.
|
|
103
|
+
- **Authorization lookups use the exact id, not a lodash path (behavior change, tightening)**: `getUserRules` (used by `getPerm` / `getPermUserInfor`), the SDK `perm().active(name)` and the edit dialogs of user groups, group permissions and permission rules now look a target, group or permission up by its exact name as an own property. Before, a name containing `.` or `[` was resolved as a path: when only `A` was granted, targets `A.0` and `A[0]` evaluated to `y` (and `A.length` to `1`), and inherited names such as `toString` could be returned. Names that are themselves keys (for example a target called `A.0` granted by a rule named `A.0`, or one called `constructor` / `__proto__`) are granted as usual. In the admin session of `modeEditUsers: 'for:grups'`, a database id containing `.` or `[` can no longer be taken over by another row's nested field. The edit dialogs also keep an item named `__proto__` when saving (before, it was shown as enabled but silently dropped from the saved JSON).
|
|
104
|
+
- **Object-form entries are named by their key (behavior change, tightening)**: in the `cgrups` / `cpemis` / `crules` JSON of the form `{"<name>": …}`, an inner `name` field no longer renames the entry (before, `{"A":{"name":"B","isActive":"y"}}` granted `B` while the edit dialogs showed `A`). The array form `[{"name":"A","isActive":"y"}]` is unchanged. The permission-rule edit dialog also reads object-form values (`{"A":{"isActive":"y"}}`) the same way as the server, so such a rule is no longer shown as disabled (and revoked on save).
|
|
105
|
+
- **`/syncAndReplaceTabs` blank rows**: a row that carries no content outside the server-managed fields is rejected with `invalidRows`. Server-managed fields are `from`, `userId`, `timeCreate`, `userIdUpdate` and `timeUpdate` (the server overwrites them); a field value counts as content when it is a non-empty string, a finite number (`0` included) or a boolean (`""`, `null`, `[]` and `{}` do not).
|
|
106
|
+
|
|
99
107
|
### Upgrading to w-serv-orm 1.1.11 / w-syslog 1.0.33 (2026-10-14)
|
|
100
108
|
- **Numeric ids are stored as strings**: a numeric row id sent to `/syncAndReplaceTabs` (or to `updatePemis`, `updateGrups`, `updateUsers`) is stored as its string form (`123` is stored as `'123'`) and the success response lists it as a string. Before, the number was replaced by a generated id while the response still showed the number. A number and its string form are the same id; `NaN` and `Infinity` count as no id (a new id is generated). `updateTargets` still accepts string ids only and rejects other ids with `saveRowFieldInvalid`.
|
|
101
109
|
- **Ids owned by another source are rejected**: if an id pushed to `/syncAndReplaceTabs` already belongs to another `from`, the whole push is rejected with `invalidRows` before anything is deleted (before, the row was skipped while the push still returned success). External applications must use ids that do not overlap with other sources.
|
package/dist/index.tmp
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,minimal-ui"><meta http-equiv="X-UA-Compatible" content="ie=edge"><meta name="referrer" content="strict-origin"><title></title><link _href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css" rel="stylesheet"><link _href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css" rel="stylesheet"><script>window.___pmwperm___={
|
|
2
2
|
urlRedirect: '{urlRedirect}',
|
|
3
3
|
language: '{language}',
|
|
4
|
-
}</script><script defer="defer" src="{sfd}/js/chunk-vendors.
|
|
4
|
+
}</script><script defer="defer" src="{sfd}/js/chunk-vendors.3e9e3ef1.js" type="module"></script><script defer="defer" src="{sfd}/js/app.963e800c.js" type="module"></script><link href="{sfd}/css/chunk-vendors.3c580e72.css" rel="stylesheet"><link href="{sfd}/css/app.6918ec45.css" rel="stylesheet"><script defer="defer" src="{sfd}/js/chunk-vendors-legacy.3e9e3ef1.js" nomodule></script><script defer="defer" src="{sfd}/js/app-legacy.963e800c.js" nomodule></script></head><body style="font-family:'Microsoft JhengHei','Avenir','Helvetica', 'Arial', 'sans-serif'; padding:0px; margin:0px;"><noscript><strong>We're sorry but w-component-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|