chore(permissions): delete dead client-side permission hooks#1608
Open
timothyfroehlich wants to merge 1 commit into
Open
chore(permissions): delete dead client-side permission hooks#1608timothyfroehlich wants to merge 1 commit into
timothyfroehlich wants to merge 1 commit into
Conversation
Stryker mutation audit (PP-x4li.2) found hooks.ts had zero test coverage and zero production consumers anywhere in src/ — all permission checks go through checkPermission() from helpers.ts directly. Confirmed via repo-wide grep before deleting. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Removes an unused client-side permissions hook layer from the permissions module, keeping permission enforcement centralized around the helper APIs (checkPermission() et al.) that are actually used across the app.
Changes:
- Removed the client-side React permission hooks module (
src/lib/permissions/hooks.ts). - Removed the corresponding hook/type re-exports from the permissions barrel (
src/lib/permissions/index.ts).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib/permissions/index.ts | Drops hook/type re-exports so the permissions barrel only exposes matrix + helper APIs. |
| src/lib/permissions/hooks.ts | Deletes the unused client-side permission hook implementations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
24
to
37
| // Helper exports | ||
| export { | ||
| type OwnershipContext, | ||
| type PermissionState, | ||
| getAccessLevel, | ||
| checkPermission, | ||
| getPermissionState, | ||
| getPermissionDeniedReason, | ||
| checkPermissions, | ||
| checkAnyPermission, | ||
| getGrantedPermissions, | ||
| getRawPermissionValue, | ||
| isConditionalPermission, | ||
| } from "./helpers"; |
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.
Summary
src/lib/permissions/hooks.ts(254 lines, 8 React hooks:usePermission,usePermissionState,usePermissions,usePermissionStates,useAccessLevel,useIsAuthenticated,useIsConditionalPermission,useRawPermission) and its re-export fromsrc/lib/permissions/index.ts.checkPermission()fromhelpers.tsdirectly instead.Test plan
pnpm run check— types, lint, format, unit (163 files / 1306 tests) all passpermissions/hooksor its exported hook/type names🤖 Generated with Claude Code