Skip to content

Unsetting "Full Module Access" silently drops "General Module Access" #5554

Description

@jrauh01

Describe the bug

In the role configuration form, unchecking a module's "Full Module Access" switch also unchecks its "General Module Access", even though the previously stored individual permissions of that module stay checked.

To Reproduce

  1. Open the form to create a new role.
  2. Enable "General Module Access" and one individual permission (e.g. /xyz) for a module.
  3. Save and reopen the role → both enabled are checked (correct).
  4. Enable "Full Module Access" for the module.
  5. Save and reopen → all of the module's permissions show as checked (and disabled) as expected.
  6. Uncheck Full Module Access.
  7. Observed: "General Module Access" is now unchecked, while the individual permission enabled in step 2 is still checked.

Expected behavior

"General Module Access" stays checked, consistent with the other previously stored permissions, i.e. the state before "Full Module Access" was enabled is restored.

Root Cause

Since 0c8466f module/<name> is explicitly added in getValues() whenever full access is set, because the full-access wildcard <module>/* does not match the module/<name> permission. So general module access always has to be tracked as its own permission. The unset in fetchEntry() then produces the inconsistency.

Suggested Fix

Handle the full permission as a general-access permission as well, so that enabling "Full Module Access" consistently implies "General Module Access" and general access is preserved across the toggle just like the individual permissions.

Your Environment

  • Icinga Web version: 2.14.0
  • Web browser: Chrome
  • PHP version: 8.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions