-
-
Notifications
You must be signed in to change notification settings - Fork 38
docs: release v2.3.0 #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: release v2.3.0 #322
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe update enhances the ZenStack framework by introducing a new Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 13
docs/the-complete-guide/part1/4-access-policy/4.8-delegate-to-relation.md
Show resolved
Hide resolved
|
|
||
| > One has full access to a `Todo` entity if he can read its parent `List` entity. | ||
| ZenStack provides a `check()` attribute function for you to delegate access control of the current model to a relation. Let's refactor the `Todo` model to use this feature 🛠️: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add hyphen to "To-do".
It appears that a hyphen is missing in the noun "To-do".
- Let's refactor the `Todo` model to use this feature 🛠️:
+ Let's refactor the `To-do` model to use this feature 🛠️:Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ZenStack provides a `check()` attribute function for you to delegate access control of the current model to a relation. Let's refactor the `Todo` model to use this feature 🛠️: | |
| ZenStack provides a `check()` attribute function for you to delegate access control of the current model to a relation. Let's refactor the `To-do` model to use this feature 🛠️: |
Tools
LanguageTool
[grammar] ~52-~52: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...model to a relation. Let's refactor theTodomodel to use this feature 🛠️: ```zmo...(TO_DO_HYPHEN)
| } | ||
| ``` | ||
|
|
||
| When authorizing an operation on a `Todo` (e.g., "update"), ZenStack will make the decision based on if the related `List` entity is readable. If you adjust the rules on `List` in the future, the `Todo` model automatically follows without needing any changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix heading level increment.
Expected: h2; Actual: h3. Heading levels should only increment by one level at a time.
- ### Parent-Child Duplication
+ ## Parent-Child DuplicationCommittable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| When authorizing an operation on a `Todo` (e.g., "update"), ZenStack will make the decision based on if the related `List` entity is readable. If you adjust the rules on `List` in the future, the `Todo` model automatically follows without needing any changes. | |
| ## Parent-Child Duplication |
Tools
LanguageTool
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...``` When authorizing an operation on aTodo(e.g., "update"), ZenStack will make t...(TO_DO_HYPHEN)
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... the rules onListin the future, theTodomodel automatically follows without ne...(TO_DO_HYPHEN)
Add hyphen to "To-do".
It appears that a hyphen is missing in the noun "To-do".
- When authorizing an operation on a `Todo` (e.g., "update"), ZenStack will make the decision based on if the related `List` entity is readable.
+ When authorizing an operation on a `To-do` (e.g., "update"), ZenStack will make the decision based on if the related `List` entity is readable.Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| When authorizing an operation on a `Todo` (e.g., "update"), ZenStack will make the decision based on if the related `List` entity is readable. If you adjust the rules on `List` in the future, the `Todo` model automatically follows without needing any changes. | |
| When authorizing an operation on a `To-do` (e.g., "update"), ZenStack will make the decision based on if the related `List` entity is readable. If you adjust the rules on `List` in the future, the `Todo` model automatically follows without needing any changes. |
Tools
LanguageTool
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...``` When authorizing an operation on aTodo(e.g., "update"), ZenStack will make t...(TO_DO_HYPHEN)
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... the rules onListin the future, theTodomodel automatically follows without ne...(TO_DO_HYPHEN)
| @@ -0,0 +1,65 @@ | |||
| --- | |||
| sidebar_label: 4.8 Delegating Access Control To Relations | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the sidebar label for consistency.
The sidebar label should start with a capital letter for consistency.
- sidebar_label: 4.8 Delegating Access Control To Relations
+ sidebar_label: 4.8 Delegating Access Control to RelationsCommittable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| sidebar_label: 4.8 Delegating Access Control To Relations | |
| sidebar_label: 4.8 Delegating Access Control to Relations |
| } | ||
| ``` | ||
|
|
||
| Although not a 100% match, the rules of `Todo` closely resemble those of `List`. How can we avoid such duplication and stay DRY? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add hyphen to "To-do".
It appears that a hyphen is missing in the noun "To-do".
- Although not a 100% match, the rules of `Todo` closely resemble those of `List`. How can we avoid such duplication and stay DRY?
+ Although not a 100% match, the rules of `To-do` closely resemble those of `List`. How can we avoid such duplication and stay DRY?Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Although not a 100% match, the rules of `Todo` closely resemble those of `List`. How can we avoid such duplication and stay DRY? | |
| Although not a 100% match, the rules of `To-do` closely resemble those of `List`. How can we avoid such duplication and stay DRY? |
Tools
LanguageTool
[grammar] ~44-~44: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...Although not a 100% match, the rules ofTodoclosely resemble those ofList. How ...(TO_DO_HYPHEN)
docs/the-complete-guide/part1/4-access-policy/4.8-delegate-to-relation.md
Show resolved
Hide resolved
|
|
||
| ### Parent-Child Duplication | ||
|
|
||
| If your application has a hierarchy of models, you'll quite often notice that the child models repeat the access policies of their parent. This can be found in our Todo schema, where `List` and `Todo` models have a parent-child relationship: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add hyphen to "To-do".
It appears that a hyphen is missing in the noun "To-do".
- This can be found in our Todo schema, where `List` and `Todo` models have a parent-child relationship:
+ This can be found in our To-do schema, where `List` and `To-do` models have a parent-child relationship:Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| If your application has a hierarchy of models, you'll quite often notice that the child models repeat the access policies of their parent. This can be found in our Todo schema, where `List` and `Todo` models have a parent-child relationship: | |
| If your application has a hierarchy of models, you'll quite often notice that the child models repeat the access policies of their parent. This can be found in our To-do schema, where `List` and `To-do` models have a parent-child relationship: |
Tools
LanguageTool
[grammar] ~12-~12: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... their parent. This can be found in our Todo schema, whereListandTodomodels ...(TO_DO_HYPHEN)
[grammar] ~12-~12: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...nd in our Todo schema, whereListandTodomodels have a parent-child relationshi...(TO_DO_HYPHEN)
|
|
||
| Checks if the current user can perform the given operation on the given field. | ||
|
|
||
| _Params_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix emphasis used instead of a heading.
Emphasis used instead of a heading.
- _Params_
+ ### ParamsAlso applies to: 930-930
Tools
Markdownlint
925-925: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
| _Params_ | ||
|
|
||
| - `field`: The field to check access for. Must be a relation field. | ||
| - `operation`: The operation to check access for. Can be "read", "create", "update", or "delete". If the operation is not provided, it defaults the operation of the containing policy rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix punctuation for readability.
A punctuation mark might be missing here.
- - `operation`: The operation to check access for. Can be "read", "create", "update", or "delete".
+ - `operation`: The operation to check access for. Can be "read", "create", "update", or "delete".Committable suggestion was skipped due to low confidence.
Tools
LanguageTool
[uncategorized] ~928-~928: Loose punctuation mark.
Context: ...Must be a relation field. -operation: The operation to check access for. Can ...(UNLIKELY_OPENING_PUNCTUATION)
[style] ~928-~928: To form a complete sentence, be sure to include a subject.
Context: ...on`: The operation to check access for. Can be "read", "create", "update", or "dele...(MISSING_IT_THERE)
Fix incomplete sentence.
To form a complete sentence, be sure to include a subject.
- Can be "read", "create", "update", or "delete".
+ The operation can be "read", "create", "update", or "delete".Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - `operation`: The operation to check access for. Can be "read", "create", "update", or "delete". If the operation is not provided, it defaults the operation of the containing policy rule. | |
| `operation`: The operation to check access for. The operation can be "read", "create", "update", or "delete". If the operation is not provided, it defaults the operation of the containing policy rule. |
Tools
LanguageTool
[uncategorized] ~928-~928: Loose punctuation mark.
Context: ...Must be a relation field. -operation: The operation to check access for. Can ...(UNLIKELY_OPENING_PUNCTUATION)
[style] ~928-~928: To form a complete sentence, be sure to include a subject.
Context: ...on`: The operation to check access for. Can be "read", "create", "update", or "dele...(MISSING_IT_THERE)
| function future(): Any {} | ||
| ``` | ||
|
|
||
| Gets the "post-update" state of an entity. Only valid when used in a "update" access policy. Read more about access policies [here](#access-policy). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix grammatical error: Use "an" instead of "a".
Use “an” instead of ‘a’ if the following word starts with a vowel sound.
- Only valid when used in a "update" access policy.
+ Only valid when used in an "update" access policy.Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Gets the "post-update" state of an entity. Only valid when used in a "update" access policy. Read more about access policies [here](#access-policy). | |
| Gets the "post-update" state of an entity. Only valid when used in an "update" access policy. Read more about access policies [here](#access-policy). |
Tools
LanguageTool
[misspelling] ~915-~915: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...e of an entity. Only valid when used in a "update" access policy. Read more about...(EN_A_VS_AN)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (15)
docs/the-complete-guide/part1/4-access-policy/4.8-keep-policies-dry.md (9)
8-8: Fix grammatical error: Use "an" instead of "a".Use “an” instead of ‘a’ if the following word starts with a vowel sound.
- in a intuitive and declarative way + in an intuitive and declarative wayTools
LanguageTool
[misspelling] ~8-~8: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...powerful tool to model authorization in a intuitive and declarative way. However,...(EN_A_VS_AN)
12-12: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- in our Todo schema + in our To-do schemaTools
LanguageTool
[grammar] ~12-~12: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... their parent. This can be found in our Todo schema, whereListandTodomodels ...(TO_DO_HYPHEN)
[grammar] ~12-~12: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...nd in our Todo schema, whereListandTodomodels have a parent-child relationshi...(TO_DO_HYPHEN)
44-44: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- the rules of `Todo` closely resemble + the rules of `To-do` closely resembleTools
LanguageTool
[grammar] ~44-~44: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...Although not a 100% match, the rules ofTodoclosely resemble those ofList. How ...(TO_DO_HYPHEN)
48-48: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- the rules of `Todo` can summarized + the rules of `To-do` can be summarizedTools
LanguageTool
[grammar] ~48-~48: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...t the policies, we'll find the rules ofTodocan summarized into a single statement...(TO_DO_HYPHEN)
[grammar] ~48-~48: The modal verb ‘can’ requires the verb’s base form.
Context: ...ies, we'll find the rules ofTodocan summarized into a single statement: > One has ful...(MD_BASEFORM)
50-50: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- access to a `Todo` entity + access to a `To-do` entityTools
LanguageTool
[grammar] ~50-~50: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... statement: > One has full access to aTodoentity if he can read its parent `List...(TO_DO_HYPHEN)
52-52: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- refactor the `Todo` model + refactor the `To-do` modelTools
LanguageTool
[grammar] ~52-~52: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...model to a relation. Let's refactor theTodomodel to use this feature 🛠️: ```zmo...(TO_DO_HYPHEN)
63-63: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- an operation on a `Todo` + an operation on a `To-do`Tools
LanguageTool
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...``` When authorizing an operation on aTodo(e.g., "update"), ZenStack will make t...(TO_DO_HYPHEN)
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... the rules onListin the future, theTodomodel automatically follows without ne...(TO_DO_HYPHEN)
63-63: Fix grammatical error: Use hyphen for "To-do".It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
- the `Todo` model automatically follows + the `To-do` model automatically followsTools
LanguageTool
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...``` When authorizing an operation on aTodo(e.g., "update"), ZenStack will make t...(TO_DO_HYPHEN)
[grammar] ~63-~63: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... the rules onListin the future, theTodomodel automatically follows without ne...(TO_DO_HYPHEN)
10-10: Fix heading level.Heading levels should only increment by one level at a time.
- ### Parent-Child Duplication + ## Parent-Child DuplicationTools
Markdownlint
10-10: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time(MD001, heading-increment)
docs/reference/zmodel-language.md (6)
915-915: Fix grammatical error: Use "an" instead of "a".Use “an” instead of ‘a’ if the following word starts with a vowel sound.
- used in a "update" access policy + used in an "update" access policyTools
LanguageTool
[misspelling] ~915-~915: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...e of an entity. Only valid when used in a "update" access policy. Read more about...(EN_A_VS_AN)
927-927: Fix punctuation for readability.A punctuation mark might be missing here.
- Must be a relation field. + Must be a relation field.Tools
LanguageTool
[uncategorized] ~927-~927: Loose punctuation mark.
Context: ...n the given field. Params -field: The field to check access for. Must be ...(UNLIKELY_OPENING_PUNCTUATION)
928-928: Fix incomplete sentence.To form a complete sentence, be sure to include a subject.
- Can be "read", "create", "update", or "delete". + The operation can be "read", "create", "update", or "delete".Tools
LanguageTool
[uncategorized] ~928-~928: Loose punctuation mark.
Context: ...Must be a relation field. -operation: The operation to check access for. Can ...(UNLIKELY_OPENING_PUNCTUATION)
[style] ~928-~928: To form a complete sentence, be sure to include a subject.
Context: ...on`: The operation to check access for. Can be "read", "create", "update", or "dele...(MISSING_IT_THERE)
[uncategorized] ~928-~928: Possible missing preposition found.
Context: ... operation is not provided, it defaults the operation of the containing policy rule...(AI_HYDRA_LEO_MISSING_TO)
928-928: Fix punctuation for readability.A punctuation mark might be missing here.
- it defaults the operation of the containing policy rule. + it defaults to the operation of the containing policy rule.Tools
LanguageTool
[uncategorized] ~928-~928: Loose punctuation mark.
Context: ...Must be a relation field. -operation: The operation to check access for. Can ...(UNLIKELY_OPENING_PUNCTUATION)
[style] ~928-~928: To form a complete sentence, be sure to include a subject.
Context: ...on`: The operation to check access for. Can be "read", "create", "update", or "dele...(MISSING_IT_THERE)
[uncategorized] ~928-~928: Possible missing preposition found.
Context: ... operation is not provided, it defaults the operation of the containing policy rule...(AI_HYDRA_LEO_MISSING_TO)
925-925: Fix emphasis used instead of a heading.Emphasis used instead of a heading.
- _Params_ + ### ParamsTools
Markdownlint
925-925: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
930-930: Fix emphasis used instead of a heading.Emphasis used instead of a heading.
- _Example_ + ### ExampleTools
Markdownlint
930-930: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
docs/reference/server-adapters/nestjs.mdx (1)
121-121: Document the purpose of the newmodelparameter.The new
modelparameter is added to thegetEnhancedPrismacallback function. Ensure to document its purpose and usage to maintain clarity.- getEnhancedPrisma: (model?: string | symbol) => unknown; + /** + * A callback for getting an enhanced `PrismaClient`. + * @param model - An optional parameter specifying the model to be used. + */ + getEnhancedPrisma: (model?: string | symbol) => unknown;
Summary by CodeRabbit
New Features
check()function in the Z-Model language to verify operation permissions on a field.ZenStackModuleOptionsinterface in NestJS with an optionalmodelparameter.Documentation
findManymethod to the list of "read" operation types.