Skip to content

Add new auditor rules for billing page

Laura Callahan requested to merge 351601-auditor into master

What does this MR do and why?

Resolves #351601 (closed)

This creates a new policy rule for auditors that allows them to view the billing page. The functionality is behind the auditor_billing_page_access feature flag.

Screenshots or screen recordings

Before After
Owner View - Group Owner view Owner view
Auditor View - Group Screen_Shot_2022-09-19_at_2.37.04_PM Screen_Shot_2022-09-19_at_2.39.46_PM (same as owner)
Guest View - Group Screen_Shot_2022-09-19_at_2.37.04_PM Guest view
All users view - Profile Profile billing Profile billingNo change

How to set up and validate locally

  • Setup and run CustomersDot
  • Within your gitlab terminal window, run export GITLAB_SIMULATE_SAAS=1
  • If GDK is already running, restart it
  • Run rails c to open the rails console
  • Run ::Gitlab::CurrentSettings.update(check_namespace_plan: true) and ::Gitlab::CurrentSettings.update(automatic_purchased_storage_allocation: true)
  • Enable auditor_billing_page_access feature flag

Group Billing Page

  • Ensure you have a group where you're an owner, or create one
  • Verify that you can still access groups/<group-name>/-/billings
  • Create an auditor user, invite them to the group, then impersonate as that user
  • Verify that you can still access groups/<group-name>/-/billings
    • The sidebar button for the billings page will not be present. This will be added in a follow up MR.
  • Attempt to access groups/<group-name>/-/billings with a guest user that's a group member but not an auditor. This should still 404.

Profile Billing Page

  • Regression test that all user types are able to access :3000/-/profile/billings

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Laura Callahan

Merge request reports