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

**URL:** <https://meta.discourse.org/t/bug-possible-for-admin-to-assign-pm-to-moderator-who-does-not-have-access-to-the-pm/116571>\
**Category:** Bug\
**Tags:** assign\
**Created:** [1 Maggio 2019, 1:46pm UTC](https://meta.discourse.org/t/bug-possible-for-admin-to-assign-pm-to-moderator-who-does-not-have-access-to-the-pm/116571 "2019-05-01T13:46:02Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)\
**Post date:** [2 Settembre 2019, 6:14pm UTC](https://meta.discourse.org/t/bug-possible-for-admin-to-assign-pm-to-moderator-who-does-not-have-access-to-the-pm/116571/9 "2019-09-02T18:14:09Z")

</div>

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:

 ![48](https://global.discourse-cdn.com/meta/original/3X/b/b/bb7fb9dc52b8a42b7aeab3e16fa1e7677ac47bcb.png)

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:

> <https://github.com/discourse/discourse-assign/pull/46>
>
> As discussed \[here\](https://meta.discourse.org/t/bug-possible-for-admin-to-assig…n-pm-to-moderator-who-does-not-have-access-to-the-pm/116571/6), it shouldn't be possible to assign a topic to a user when:
> 
> \- The user won't be able to see the topic.
> \- The user is not a member of the assign allowed users.
> 
> This PR adds some backend rules to prevent these scenarios.

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

---

_[View the full topic](https://meta.discourse.org/t/bug-possible-for-admin-to-assign-pm-to-moderator-who-does-not-have-access-to-the-pm/116571)._
