Problem/Motivation
While setting the module up I noticed, that only admins can visit the Google Analytics page provided by the module. The reason is, that the permissions seemed to have not been configured properly.
1. In ga_node_reports.permissions.yml file the permission key is called administer ga node reports config
There is no configuration page for the module, so that permission is wrongly named.
2. In ga_node_reports.links.task.yml this permission was used. So the tab will appear for all users with the permission.
3. In ga_node_reports.routing.yml the required permission is called View Google analytics node reports
.
Permissions need to be defined by its key, not its description. This means non-admins haven't been able to visit that page. User 1 only, because they are bypassing the access check.
Proposed resolution
I would propose to rename the whole permission to view ga node reports
to make its purpose clear. Then changing the different yml files to use this permission. This is the cleanest solution, because we don't have an admin configuration page for the module, but might get this in the future.
I'm not sure if we need an update hook for updating the role permissions, because as far as I can see it, it was not possible to access the statistics for non-use 1.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet