Skip to content

Commit

Permalink
Remove per-row permissions limit (#3086)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-codaio authored Oct 10, 2024
1 parent b43ab5b commit 216b6c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 59 deletions.
32 changes: 1 addition & 31 deletions api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1167,15 +1167,6 @@ export interface SyncUpdateResultMarshaled<
*/
export type GenericSyncUpdateResultMarshaled = SyncUpdateResultMarshaled<any, any, any>;

/**
* Sets a limit on the number of permissions that can be returned for a single row
* in a call to {@link executeGetPermissions}.
*
* TODO(sam): Unhide this
* @hidden
*/
const MaxPermissionsPerRow = 1000;

/**
* Type definition for the result of calls to {@link executeGetPermissions}.
*
Expand Down Expand Up @@ -2313,7 +2304,7 @@ export function makeSyncTable<
const {
execute: wrappedExecute,
executeUpdate: wrappedExecuteUpdate,
executeGetPermissions: wrappedExecuteGetPermissions,
executeGetPermissions,
...definition
} = maybeRewriteConnectionForFormula(formula, connectionRequirement);

Expand Down Expand Up @@ -2439,27 +2430,6 @@ export function makeSyncTable<
}
: undefined;

const executeGetPermissions = wrappedExecuteGetPermissions
? async function execGetPermissions(
params: ParamValues<ParamDefsT>,
request: ExecuteGetPermissionsRequest<K, L, SchemaDefT>,
context: GetPermissionExecutionContext,
) {
const result = await wrappedExecuteGetPermissions(params, request, context);
const {rowAccessDefinitions: permissions} = result;
const oversizedRowAccessDefinitions = permissions.filter(p => p.permissions.length > MaxPermissionsPerRow);

if (oversizedRowAccessDefinitions.length > 0) {
throw new Error(
`Objects with ids: ${oversizedRowAccessDefinitions
.map(p => p.rowId)
.join(', ')} returned more permissions than the maximum allowed of ${MaxPermissionsPerRow} per object`,
);
}
return result;
}
: undefined;

return {
name,
description,
Expand Down
23 changes: 1 addition & 22 deletions dist/api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 216b6c2

Please sign in to comment.