# 输入"ga"总是打开用户的作业，即使他们无法访问。

**URL:** <https://meta.discourse.org/t/entering-ga-always-opens-a-users-assignments-even-when-they-cant-access-them/307599>\
**Category:** Bug\
**Tags:** assign\
**Created:** [2024年五月10日 22:53 UTC](https://meta.discourse.org/t/entering-ga-always-opens-a-users-assignments-even-when-they-cant-access-them/307599 "2024-05-10T22:53:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)\
**Post date:** [2024年五月10日 22:53 UTC](https://meta.discourse.org/t/entering-ga-always-opens-a-users-assignments-even-when-they-cant-access-them/307599/1 "2024-05-10T22:53:47Z")

</div>

在 Discourse 分配中，任何地方都可以重现此问题，包括此处。只需在非文本框区域输入 `ga`，绑定就会触发，无论您是否有权限执行此操作。\n

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/d/6/8d6a1a28ff71a5cc3977d90fa0aa18f27f3d9884.png)

---

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2024年五月11日 00:02 UTC](https://meta.discourse.org/t/entering-ga-always-opens-a-users-assignments-even-when-they-cant-access-them/307599/2 "2024-05-11T00:02:39Z")

</div>

抓得好 👍

> <https://github.com/discourse/discourse-assign/blob/main/assets/javascripts/discourse/initializers/extend-for-assigns.js#L758>

那一行可能需要移到 `api.getCurrentUser()?.can_assign` 条件内。
