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.
Code Review
1.
perm.system.role.edit()called inside acomputedIssues:
perm.system.role.edit()is a function returning a plain boolean (not reading reactive state), this is fine — but the!negation combined with short-circuit means it's only evaluated wheninternal === false. Not a bug, just noted.perm.system.role.edit()internally reads reactive state, the computed will track it correctly. ✔ Good.Potential concern: If
perm.system.role.edit()reads from a store/composable that may not be initialized yet at setup time, and the permission resolves asynchronously later, make sure the underlying source is reactive so thecomputedre-evaluates. If permissions are fetched via an async call into a non-reactive variable,disabledwill be stale.2.
permissionTableKeytied todisabledThis forces a remount of the table whenever
disabledflips — reasonable if the child really needs remount (e.g., different internal state), but if the only difference is read-only behavior, a plain prop would suffice and avoid a full teardown/re-render cost. Optimization suggestion: prefer passingdisableddown as a prop unless there's a concrete reason for a key-based reset.3.
showCategorydeclared but unused in diffconst showCategory = ref(true)— verify it's still used elsewhere; otherwise dead code.4. Minor style / consistency
disabledis generic;isReadonlyorisPermissionMatrixDisabledconveys intent better.5. Logic check
For a built-in role (
internal === true), the second operand isn't evaluated — good for performance and avoids unnecessary permission-store access. For non-internal roles, edit permission is required to allow editing — matches the comment. ✔Summary
perm.system.role.edit()reads reactive state (sodisabledupdates on permission changes).permissionTableKeyremount is truly needed vs. a prop.