Wagtail Admin: Modify the dashboard hook so that it only displays the count of media files for users who have the appropriate permission
Presently, the wagtail media app always injects the number of media files into the user's dashboard, regardless of whether they have permission to view the count or not.
The count of files (like other components of the site) should respect the group permissions for which the user is a member. If the user does not have permission to view or upload media files, the count (with the resulting link) should be omitted from the dashboard.