Skip to content

Hide custom dashboard configuration banner if no permissions

What does this MR do and why?

Hides the custom dashboard configuration banner prompt on projects analytics dashboards when the current user does not have enough permissions to actually configure this value.

For group analytics dashboards, always hide the banner, as current groups iteration does not intend to support this feature. Hide Configure button for groups analytics dash... (#419658 - closed)

:admin_project permission is used, which match the permissions that are enforced when viewing the project settings pages which the banner links to (maintainer and above will see the banner)

Screenshots or screen recordings

(when user does not have permission)

Before After
(project, logged in as "developer") image image
(group, logged in as "developer") image image
(group, logged in as "maintainer") image image

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Enable feature flag for Group level analytics dashboards: echo "Feature.enable(:group_analytics_dashboards)" | gdk rails c
  3. Find a group which does not already have a dashboard pointer project configured
  4. Visit the analytics dashboards list, e.g. http://gdk.test:3000/groups/gitlab-instance-c8b17bf8/-/analytics/dashboards
  5. Verify the banner does not display at all despite logged in user permissions
  6. Find a project which does not already have a dashboard pointer project configured
  7. Visit the analytics dashboards list at Project -> Analyze -> Application analytics
  8. Verify the banner does / does not display when logged in as users with different permissions

MR acceptance checklist

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

Related to #415776 (closed)

Edited by Elwyn Benson

Merge request reports