Skip to content

Commit

Permalink
refactor: refactor policy definition and generation code (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored May 26, 2024
1 parent aade41d commit ea105d1
Show file tree
Hide file tree
Showing 25 changed files with 1,161 additions and 977 deletions.
35 changes: 0 additions & 35 deletions packages/runtime/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,41 +63,6 @@ export const PRISMA_PROXY_ENHANCER = '$__zenstack_enhancer';
*/
export const PRISMA_MINIMUM_VERSION = '5.0.0';

/**
* Selector function name for fetching pre-update entity values.
*/
export const PRE_UPDATE_VALUE_SELECTOR = 'preValueSelect';

/**
* Prefix for field-level read checker function name
*/
export const FIELD_LEVEL_READ_CHECKER_PREFIX = 'readFieldCheck$';

/**
* Field-level access control evaluation selector function name
*/
export const FIELD_LEVEL_READ_CHECKER_SELECTOR = 'readFieldSelect';

/**
* Prefix for field-level override read guard function name
*/
export const FIELD_LEVEL_OVERRIDE_READ_GUARD_PREFIX = 'readFieldGuardOverride$';

/**
* Prefix for field-level update guard function name
*/
export const FIELD_LEVEL_UPDATE_GUARD_PREFIX = 'updateFieldGuard$';

/**
* Prefix for field-level override update guard function name
*/
export const FIELD_LEVEL_OVERRIDE_UPDATE_GUARD_PREFIX = 'updateFieldGuardOverride$';

/**
* Flag that indicates if the model has field-level access control
*/
export const HAS_FIELD_LEVEL_POLICY_FLAG = 'hasFieldLevelPolicy';

/**
* Prefix for auxiliary relation field generated for delegated models
*/
Expand Down
Loading

0 comments on commit ea105d1

Please sign in to comment.