mysociety / fixmystreet

This is mySociety's popular map-based reporting platform: easy to install in new countries and regions
http://fixmystreet.org/
Other
501 stars 235 forks source link

Markup problem details role seems to be required in order for users to show up in the assignment dropdown #4970

Open jonkri opened 2 months ago

jonkri commented 2 months ago

Describe the bug

If a user is missing the Markup problem details role then that user doesn't seem to show up in the assignment dropdown in the inspection form. This is the case even if the user has the Manage shortlist permission.

To Reproduce

Steps to reproduce the behavior:

  1. Create a body user with the following permissions: Create reports/updates as anonymous user, Create reports/updates as the council, Default to creating reports/updates as the council, Manage shortlist, Edit reports and Edit report category.
  2. Try to assign a report to the body user created in Step 1.

Expected behavior

The user created in Step 1 above shows up in the assignment dropdown.

Screenshots

Not applicable.

Desktop (please complete the following information):

Not applicable.

Smartphone (please complete the following information):

Not applicable.

Additional context

Not applicable.

jonkri commented 1 month ago

Related to #4855, when a user doesn't show up in the dropdown because of this, and the same user shortlists the problem, the wrong user is displayed in the assignment dropdown.

jonkri commented 1 month ago

Would it make sense to display users with the Manage shortlist (planned_reports) permission in the assignment dropdown instead?

-[% inspectors = c.user.from_body.staff_with_permission('report_inspect') %]
+[% inspectors = c.user.from_body.staff_with_permission('planned_reports') %]
dracos commented 1 month ago

In our database, looks like we currently have:

I can't easily say whether any of those use the shortlist assignment or not, but from that I'd say whilst we could almost certainly add planned_reports to the list on top of report_inspect users, I don't think we could change it from one to the other.

jonkri commented 1 month ago

Interesting!

Adding planned_reports to the list on top of report_inspect users would work for us.

dracos commented 1 month ago

Although... having thought about it some more, is there any point to someone being able to be assigned if they can't then look at their shortlist? What do we do with this, would need a bit of looking to see what it's used for.

jonkri commented 2 weeks ago

is there any point to someone being able to be assigned if they can't then look at their shortlist?

That's a good question!

I guess the only point to it would be if...

If this scenario is irrelevant then I would suggest that we only display planned_reports users in the assignment dropdown like I suggested above since adding planned_reports to the list on top of report_inspect users would in this case have these drawbacks:

Perhaps you could identify the managers of these 307 users (that have the report_inspect permission but not the planned_reports permission) and contact the managers to see if they would mind adding the planned_reports permission to the report_inspect users. If this is feasible then we could carry out a change like the one I suggested without changing the content of the assignment dropdown.

Also, perhaps it could be interesting to check how many of the 307 users that you mentioned that are actually assigned to reports (and not being able to see the reports in their shortlist). If no report_inspect users are assigned this could perhaps indicate that they shouldn't be in the assignment dropdown in the first place. In this case the managers could be asked if the users can be removed from the assignment dropdown, which would have the extra benefit of making the dropdown less cluttered.