feat: Allow admin/owner to opt out of auto-approval #2245
+102
−28
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.
Description
This PR implements an option for admin and owner accounts to disable auto-approval of their own requests, addressing a long-standing feature request. Admin requests can now go through the normal pending → approved flow, enabling integration with third-party tools and manual queue management.
Why is this change required? Currently, any request made by an admin or owner account is automatically approved and begins processing immediately. This behavior:
What problem does it solve? This change allows admins to opt out of auto-approval while preserving all existing administrative permissions and functionality. It also fixes a typo in watchlist sync that prevented TV watchlist items from creating requests.
Key Changes:
server/lib/permissions.tsto treat auto-approve permissions explicitly for admin usersserver/entity/MediaRequest.tsto removePermission.MANAGE_REQUESTSfrom auto-approval status checkserver/routes/user/usersettings.tsfor owner to modify their own auto-approve permissionsserver/lib/watchlistsync.ts(AUTO_APPROVE_TV → AUTO_REQUEST_TV)Permission Behavior:
Admin bypass preserved for all non-auto-approve permissions (MANAGE_, REQUEST_, VIEW_*, etc.)
Auto-approve permissions (AUTO_APPROVE*) now require explicit grant, even for admins
All other administrative functions continue to work as before
Fixes [Feature Request] Option to disable auto approve for admin and owner accounts #191
Note: This PR description was generated by a heavily scrutinized Claude Code based on very detailed requirements by the code author. Coding assistance was also provided by CC, although this too was closely supervised and always read and understood before each change was implemented. Some code and how to address the problem was also inspired by an Overseerr fork by @ohmzi.
How Has This Been Tested?
Testing Environment:
Functional Tests Performed:
/auth/mereturns 200)Edge Cases Verified:
hasPermission(0, ...)returnstrue(any logged-in user)hasPermission([], ...)returnstrue(empty array)hasPermission([AUTO_APPROVE], ...)requires explicit bit for adminhasPermission([MANAGE_REQUESTS], ...)allows admin bypassComprehensive Permission Audit:
All permission behaviors preserved with one intentional change:
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extract- Not required, no new UI text added