Repository navigation
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.
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.
Here's my review of the diff:
Change reviewed:
Potential issues / irregularities
Ordering inconsistency
The scopes are now listed as
WORKSPACE_RESOURCEfirst, thenWORKSPACE. If scope lists elsewhere in the codebase are ordered from broadest to narrowest (or vice versa), this may break consistency. Check whether order matters when scopes are validated or matched (e.g., first-match logic).Semantics of combined scopes
Combining
WORKSPACE_RESOURCEandWORKSPACEmeans this permission can be granted both at workspace level and at individual resource level. Confirm that:Duplicate/overlap risk
If
WORKSPACE_RESOURCEis conceptually a sub-scope ofWORKSPACE, having both may be redundant or may cause double-counting in scope-expansion logic. Verify whether inheritance is already handled automatically elsewhere.Missing tests / no accompanying change
This is a pure metadata change with behavioral implications for authz. Ensure tests cover:
WORKSPACE_RESOURCEscope.WORKSPACEscope.Enum availability
Confirm
PermissionScopeConstants.WORKSPACE_RESOURCEactually exists and is defined consistently (name and value) across environments; a typo here would fail at import time rather than test time.Migration/compat concerns
Existing role assignments created before this change won't have
WORKSPACE_RESOURCEin their scope. If any code assumes the permission requires both scopes, existing users could suddenly be denied. Consider graceful fallback.Formatting/lint
Line length may exceed the project's max (80/88/100 chars). Run the formatter/linter to confirm.
Optimization suggestions
WORKSPACE_RESOURCE, consider a helper/factory to reduce repetition and enforce consistent ordering.Verdict
The change itself is syntactically fine, but it has real authorization semantics implications. The main risks are (a) ordering/duplicates, (b) behavior for pre-existing assignments without the new scope, and (c) lack of accompanying tests. Address these before merging.