Skip to content

Fix 404 when removing all permissions from an API client#1484

Merged
edilsonacjr merged 2 commits intomainfrom
edilsonacjr/fix-removal-of-all-permissions
Apr 14, 2026
Merged

Fix 404 when removing all permissions from an API client#1484
edilsonacjr merged 2 commits intomainfrom
edilsonacjr/fix-removal-of-all-permissions

Conversation

@edilsonacjr
Copy link
Copy Markdown
Contributor

@edilsonacjr edilsonacjr commented Apr 14, 2026

  • When all permission checkboxes are unchecked on the API client edit form, the browser omits the api_client[permissions][] parameter entirely, causing params.require(:api_client) to raise ActionController::ParameterMissing and return a 404
  • Added a hidden field to ensure the api_client parameter is always present in the form submission
  • Filter out the blank hidden field value in the controller so the permissions array is clean

Test plan

  • Go to /api_clients/:id for an existing API client with permissions
  • Uncheck all permission checkboxes and click Update
  • Verify the update succeeds and all permissions are removed
  • Verify updating with some permissions checked still works as before

@edilsonacjr edilsonacjr merged commit 3b20110 into main Apr 14, 2026
27 of 29 checks passed
@edilsonacjr edilsonacjr deleted the edilsonacjr/fix-removal-of-all-permissions branch April 14, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants