Commit 120e6df
`canEdit`'s contract doc listed ownership and an `edit`-level share and
stopped there, while the implementation has carried a third branch since
#4647: the `modifyAllRecords` super-user write bypass, probed through
`ISecurityService.hasWriteBypass` after ownership and shares both fail
(`packages/plugins/plugin-sharing/src/sharing-service.ts:398-400`, via
`hasModifyAllBypass` at :341-351).
The omission was worse than silence because `canDelete` sits four lines
below naming the same bypass ("ownership (widened by write DEPTH) or the
`modifyAllRecords` super-user bypass ONLY"), so the pair read as a
deliberate exclusion on the update gate -- the exact opposite of the code.
The wording now matches `canDelete`'s, and names the same permission the
implementation actually checks (`bit: 'modify'` -> `op.modifyAllRecords`,
`permission-evaluator.ts:superuserBypassSets`).
Adds a parity pin over the interface's own JSDoc: the three write gates
(`canEdit` / `canDelete` / `canManageShares`) must each name the bypass,
`buildReadFilter` must not (the read path has no `hasWriteBypass` branch),
and the member enumeration is asserted whole so a rename cannot empty it.
Nothing type-checks a doc comment, and prose is what drifted here.
Comment + test only: no schema, type, export or behaviour change.
Claude-Session: https://claude.ai/code/session_01559M8FVm6W6vDLABL3jvdW
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 846ed1f commit 120e6df
2 files changed
Lines changed: 86 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
132 | 141 | | |
133 | 142 | | |
134 | 143 | | |
| |||
0 commit comments