Repository navigation
fix: application chat user quota setting permission - #7964
Merged
peslyn merged 1 commit intoNov 17, 2026
Merged
Conversation
shaohuzhang1
commented
Nov 17, 2026
| */ | ||
| quotaSetting: () => canSys(P.CHAT_USER_QUOTA_SETTING), | ||
| quotaSetting: () => canSys(P.CHAT_USER_QUOTA_SETTING) && (hasEdition(Edition.PE) || hasEdition(Edition.EE)), | ||
| } |
Contributor
Author
There was a problem hiding this comment.
No syntax/logic error in the diff. The &&/|| precedence is correct because of the parentheses.
Review points:
-
Import consistency
hasEditionis imported from'../../core', butEditionis imported from'@/permission/core/common'.- If
Editionis already re-exported by'../../core', import both from the same barrel to avoid inconsistent module resolution and possible duplicate module instances. - Also check import ordering/lint rules: the
@/...import is placed after relative imports.
-
Potential circular dependency
- Importing
Editiondirectly from@/permission/core/commonmay create a circular dependency ifcommonimports from permission/policy modules. - Prefer importing from the existing permission core barrel if possible.
- Importing
-
Edition gate in permission layer
quotaSettingnow mixes system permission and edition/feature gating.- Confirm this is intentional. If edition gating is a product/feature rule, consider centralizing it in a helper such as
canUseQuotaSetting()orisQuotaSettingEdition()instead of embedding edition logic in every permission rule. - Make sure the backend enforces the same edition restriction; frontend permission checks must not be the only gate.
-
PE || EElogic- If
hasEdition(Edition.EE)already implies all PE features, this condition may be redundant. - If
hasEditionis an exact-match check, the current condition is fine. - Consider a named helper for readability, e.g.:
const isQuotaEdition = () => hasEdition(Edition.PE) || hasEdition(Edition.EE) quotaSetting: () => canSys(P.CHAT_USER_QUOTA_SETTING) && isQuotaEdition(),
- If
-
Tests
- Add/update tests for:
- system permission allowed + PE edition →
true - system permission allowed + EE edition →
true - system permission allowed + other edition →
false - system permission denied + PE/EE →
false
- system permission allowed + PE edition →
- Mock
hasEditionexplicitly to avoid environment-dependent tests.
- Add/update tests for:
-
Runtime behavior
- Ensure
hasEditionis synchronous and safe to call during permission evaluation/menu rendering. - If edition/license state can change at runtime, the current function re-evaluates on each call, which is correct; just ensure callers do not cache the result incorrectly.
- Ensure
Overall: the change is functionally plausible, but import consistency, circular-dependency risk, and test coverage should be checked.
peslyn
deleted the
pr@v3@fix_application_chat_user_quota_setting_permission
branch
November 17, 2026 06:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: application chat user quota setting permission