# hbs ValueListで非管理者として問題が発生--代わりに何を使用すべきか？

**URL:** https://meta.discourse.org/t/trouble-with-hbs-valuelist-as-non-admin-what-to-use-instead/290650
**Category:** Development
**Created:** [2024 年 1 月 5 日午後 5:52 UTC](https://meta.discourse.org/t/trouble-with-hbs-valuelist-as-non-admin-what-to-use-instead/290650 "2024-01-05T17:52:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2024 年 1 月 5 日午後 5:52 UTC](https://meta.discourse.org/t/trouble-with-hbs-valuelist-as-non-admin-what-to-use-instead/290650/1 "2024-01-05T17:52:18Z")

</div>

[https://dashboard.literatecomputing.com/](https://dashboard.literatecomputing.com/) にある私のコードは、管理者としては機能していましたが（通常のユーザーとしても長い間機能していたと確信しています）、現在は通常のユーザーとしては失敗しています。

このコードをページに含めると、管理者としては機能しますが、通常のユーザーとしては機能しません。

```plaintext
        <ValueList
          @values={{this.server.custom_plugins}}
          @inputType="array"
          @addKey="pfaffmanager.server.custom_plugins_suggestion"
        />

```

通常のユーザーが `this.server.custom_plugins` にアクセスできることを確認しました。

奇妙なのは、通常のユーザーとしてページにアクセスすると、ページには何もレンダリングされず、エラーが発生している行を削除するとログに記録される `hbs` の `{{log ...}}` 行さえも表示されないことです。

```plaintext
エラーが発生しました:

- レンダリング中:
  -トップレベル
    application
      discourse-root
        pfaffmanager
          pfaffmanager.servers
            pfaffmanager.servers.edit

```

別の `<ValueList... />` も同様の問題を引き起こしています。他に何か使用すべきものはありますか？ . . . 待ってください。`<ValueList />` が見つかるのは管理者コンポーネントだけです。

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs#L29](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs#L29)

ユーザーがプラグインを選択できるように、このセレクターを使用しています。

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/7/5/6759dbbc770e7681294b503bde0aec7089a9de8a.png)

以前は何をしていたのか覚えていません。Ember 5 のアップグレードのためにこれを行ったのでしょうか？

他に何かすべきことはありますか？

編集: `<ValueList />` は管理者専用であり、独自の valueList を作成してから、なぜ作成したのか疑問に思い、削除したというあいまいな記憶があります。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2024 年 1 月 5 日午後 7:16 UTC](https://meta.discourse.org/t/trouble-with-hbs-valuelist-as-non-admin-what-to-use-instead/290650/2 "2024-01-05T19:16:21Z")

</div>

以前作成した`PvalueList`（管理画面のvalue-ilistからコピーしたもの）を見つけて、githubから復元しました。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2024 年 2 月 4 日午後 7:16 UTC](https://meta.discourse.org/t/trouble-with-hbs-valuelist-as-non-admin-what-to-use-instead/290650/3 "2024-02-04T19:16:43Z")

</div>

このトピックは、最後の返信から30日後に自動的にクローズされました。新しい返信は許可されていません。
