Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfitz committed Jul 24, 2024
1 parent 6e00834 commit b6ec4c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/server/lib/GranularAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,8 @@ export class GranularAccess implements GranularAccessForBundle {
// approximate with the user's access rights at beginning of
// bundle.
// We also check for +S in scenarios that are hard to break down
// in a more granular way.
// in a more granular way, for example ConvertFromColumn and
// CopyFromColumn.
if (scanActionsRecursively(actions, (a) => this.needEarlySchemaPermission(a))) {
await this._assertSchemaAccess(docSession);
}
Expand Down
6 changes: 6 additions & 0 deletions test/server/lib/GranularAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ describe('GranularAccess', function() {
{id: 'B', type: 'Int'},
{id: 'C', type: 'Int'}]],
['AddRecord', '_grist_ACLResources', -1, {tableId: 'Table1', colIds: 'C'}],
// Add at least one access rule. Otherwise the test would succeed
// trivially, via shortcuts in place when the GranularAccess
// hasNuancedAccess test returns false. If there are no access
// rules present, editors can make any edit. Once a granular access
// rule is present, editors lose some rights that are simply too
// hard to compute or we haven't gotten around to.
['AddRecord', '_grist_ACLRules', null, {
resource: -1, aclFormula: 'user.Access == OWNER', permissionsText: '-R',
}],
Expand Down

0 comments on commit b6ec4c0

Please sign in to comment.