Bug: possibile assegnare un PM a un moderatore senza accesso ai PM

I have noticed what I think is a bug with the Discourse Assign - #117 plugin. It is possible for an admin to assign a PM to a moderator who does not have access to the PM. They are notified, but when they click through to see the PM they cannot see it and get an error.

The answer, it seems to me, should be to add the assignee to the message at the same time, or to display an error to the assigner to let them know the assignee is not in the message and cannot be assigned the message.

This obviously does not affect admins who can see all PMs.

5 Mi Piace

I can repro this. An assign notification is generated despite the user not having access to the PM assigned. Same issue occurs in categories with security that mods can’t access.

5 Mi Piace

Oh yeah interesting edge case what can we do here @sam?

4 Mi Piace

I think a minimum change here is to pop up an error saying moderator has no access to the PM when the admin / mod tries to assign.

This particular edge case will become much less of an edge case when we unlock “assign” to designated groups that are not mods.

4 Mi Piace

Oggi mi sono imbattuto di nuovo in questo: stiamo scoprendo che ho assegnato molti messaggi a moderatori che non hanno accesso ad essi e, di conseguenza, non li hanno seguiti. Ops.

2 Mi Piace

LOL possiamo proteggere da quanto sopra @sam in qualche modo semplice?

3 Mi Piace

Questo è successo ora, forse @Roman può prenderne in carico il seguito.

5 Mi Piace

Ho aperto una PR per imporre regole aggiuntive quando si tenta di assegnare un argomento:

  • L’utente a cui stiamo per assegnare deve avere i permessi per assegnare.
  • L’utente a cui stiamo per assegnare deve avere accesso all’argomento.

Tentare di assegnare a uno di questi utenti genererà un errore:

Penso che dovremmo anche rimuovere gli utenti senza accesso dai risultati del modale di assegnazione. Per farlo, dovrò estendere leggermente l’API di ricerca utenti del core.

Ecco la PR:

Troverò qualcuno che la revisioni prima di effettuarne il merge.

6 Mi Piace