Skip to content

Answer 404 from the permission actions popup for an unknown group or permission (2.4.x) - #1012

Merged
KrzysztofPajak merged 2 commits into
2.4.xfrom
fix/2.4.x-permission-action-unknown-entity
Nov 2, 2026
Merged

KrzysztofPajak merged 2 commits into
2.4.xfrom
fix/2.4.x-permission-action-unknown-entity

Conversation

@KrzysztofPajak

@KrzysztofPajak KrzysztofPajak commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Type: bugfix

Issue

The permission actions popup edits one permission of one customer group, so both must exist. PermissionsAction had no proper answer when one of them does not, and the save changed the denied actions before it looked at the permission.

Solution

  • PermissionsAction (GET) answers 404 when the customer group or the permission does not exist.
  • PermissionsAction (POST) checks both before it changes anything, and answers 404 in the same cases. The 404 has a text body, because an empty one is re-executed at /page-not-found as a POST and runs a storefront action.
  • The popup shows that message when a save is rejected, and stays open.
  • The ViewBag.ClosePage writes go, because no view reads them. The popup closes from its own script after a successful save.

No new resources, settings or migrations.

Breaking changes

None.

Testing

Unit tests pass: Grand.Web.Admin.Tests (1562), with eight new tests in PermissionControllerTests. The tests for an unknown group or permission failed before the change. The steps below were not run on this branch. The same change was run on the develop pull request #1011.

  1. Open /Admin/Permission/Index and open the actions popup of a permission.
  2. Turn an action off and save. The popup closes.
  3. Open the popup again. The action is still off.

support added 2 commits November 1, 2026 21:59
…permission (2.4.x)

The popup edits one permission of one customer group, so both must exist.
The save checks them before it changes anything.
An empty 404 on the POST is re-executed by the status code pages at
/page-not-found, still as a POST, where it ran the storefront's
BlogController.BlogPost. A 404 with a body is left alone. The popup had no
error callback, so a rejected save showed nothing and stayed open.

Also cover removing an earlier denial and saving with nothing selected.
@KrzysztofPajak
KrzysztofPajak merged commit b7a364e into 2.4.x Nov 2, 2026
1 check passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/2.4.x-permission-action-unknown-entity branch November 2, 2026 06:20
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.

1 participant