Page MenuHomeSoftware Heritage

mailmap admin interface: only display mailmaps matching a search pattern
Closed, MigratedEdits Locked

Description

Currently, the mailmap admin interface shows a paginated list of all mailmaps.

While this is a very restricted feature that's only available to a small set of users, dumping all the information by default is an abuse risk.

I would be more comfortable if this admin interface only displayed (and retrieved from the server!) the entries that would be selected using a (non-null prefix?) search pattern.

Event Timeline

olasd triaged this task as Normal priority.Apr 28 2022, 2:43 PM
olasd created this task.

Indeed some filtering could be added here based on user permission:

  • if user has permission swh.web.mailmap, only the mailmaps he created should be displayed
  • if user has permission swh.web.admin.mailmap, all mailmaps should be displayed

Fortunately, this requires few changes in the current implementation:

  • mailmap admin UI link should also be displayed for users with permission swh.web.mailmap
  • mailmap filtering for admin user in related HTTP endpoints should be adapted as currently it only return mailmaps with user_id equals to None, all mailmaps should be returned regardless who created them for admin.

So after those changes, setting the swh.web.mailmap permission should be sufficient for people external to the team to add new mailmaps.
We should reserve the swh.web.admin.mailmap permission for staff users only.