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") ![]() |
![]() |
(group, logged in as "developer") ![]() |
![]() |
(group, logged in as "maintainer") ![]() |
![]() |
How to set up and validate locally
- Follow these instructions to setup Product Analytics in GDK.
- Enable feature flag for Group level analytics dashboards:
echo "Feature.enable(:group_analytics_dashboards)" | gdk rails c
- Find a group which does not already have a dashboard pointer project configured
- Visit the analytics dashboards list, e.g.
http://gdk.test:3000/groups/gitlab-instance-c8b17bf8/-/analytics/dashboards
- Verify the banner does not display at all despite logged in user permissions
- Find a project which does not already have a dashboard pointer project configured
- Visit the analytics dashboards list at Project -> Analyze -> Application analytics
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #415776 (closed)