Allow read_admin_monitoring access to admin/audit_logs

What does this MR do and why?

This changes allows restricted admins with the read_admin_monitoring permission to access the admin area audit logs page. The sidebar navigation will be updated in a follow-up MR. This change is also gated behind the custom_ability_read_admin_monitoring feature flag.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Enable the feature flag via a rails console
    Feature.enable(:custom_ability_read_admin_monitoring)
  2. Visit instance level Roles and Permissions page http://gdk.test:3000/admin/application_settings/roles_and_permissions
  3. Create a new Role with the read_admin_monitoring permission enabled.
  4. Open a separate browser and register a new account.
  5. Open a rails console and assign the new role to the new account
    License.feature_available?(:custom_roles)
    user = User.find_by(username: 'read_admin_monitoring')
    role = MemberRole.find_by(name: 'read_admin_monitoring')
    Users::UserMemberRole.create!(member_role: role, user: user)
    user.can?(:read_admin_monitoring)
  6. Visit the admin/audit_logs page using the new account http://gdk.test:3000/admin/audit_logs
  7. Verify that the page loads
Edited by Ian Anderson

Merge request reports

Loading