Bug - possível para o administrador atribuir PM a moderador que não tem acesso ao 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 curtidas

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 curtidas

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

4 curtidas

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 curtidas

Hoje mesmo, encontrei isso novamente — estamos percebendo que atribuí muitas mensagens a moderadores que não têm acesso a elas e, portanto, não as estão acompanhando. Ops.

2 curtidas

KKK, conseguimos nos proteger contra o acima mencionado de alguma forma simples, @sam?

3 curtidas

Isso aconteceu agora, talvez @Roman possa dar continuidade.

5 curtidas

Abri um PR para impor regras adicionais ao tentar atribuir um tópico:

  • O usuário que vamos atribuir deve ter permissão para atribuir.
  • O usuário que vamos atribuir deve ter acesso ao tópico.

Tentar atribuir a um desses usuários resultará em um erro:

Acho que também devemos remover usuários sem acesso dos resultados do modal de atribuição. Para isso, precisarei expandir um pouco a API de pesquisa de usuários do núcleo.

Aqui está o PR:

Vou encontrar alguém para revisar antes de mesclar.

6 curtidas