# モデレーター向けにデータエクスプローラーを公開

**URL:** https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613
**Category:** Feature
**Tags:** pr-welcome, data-explorer
**Created:** [2018 年 3 月 27 日午前 7:33 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613 "2018-03-27T07:33:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018 年 3 月 27 日午前 7:33 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/1 "2018-03-27T07:33:18Z")

</div>

isn’t it better if this plugin be available for **moderators** as well?

currently only admins have access to the plugin, and mods get this error when clicking on the plugin: “The [data explorer](https://meta.discourse.org/t/32566?silent=true) is only available to admins.”

moderators also need to be able to analysis some user behaviors, and direct access to the plugin helps.

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [2018 年 3 月 27 日午前 11:40 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/2 "2018-03-27T11:40:38Z")

</div>

This would give them complete read only access to your database. Not recommended in all cases I do not think

For example all they need to do is do

`select * from api_keys`

With that then they have access to the system & any admin generated API Keys allowing them to perform admin functions.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2018 年 3 月 27 日午後 2:55 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/3 "2018-03-27T14:55:28Z")

</div>

> [@Discourse Data Explorer](https://meta.discourse.org/t/discourse-data-explorer/32566/126):
>
> isn’t it better if this plugin be available for moderators as well?
> 
> currently only admins have access to the plugin, and mods get this error when clicking on the plugin: “The [data explorer](https://meta.discourse.org/t/32566?silent=true) is only available to admins.”
> 
> moderators also need to be able to analysis some user behaviors, and direct access to the plugin helps.

There is a whole discussion somewhere on meta about admins vs moderators, and how much trust to put in them. The discourse team all have admin privs here on meta, for example, as you can see on the about page. Personally I limit it (just two of us have admin privs) and then the two of us own the hassle of having to run reports and share them with the rest of the team. This is less than ideal - really we just limit the access to avoid having to train everyone on what to stay away from. Not everyone on my team is interested in seeing all the admin features, even if we do trust them with the data.

Can you give an example of the type of analysis moderators need to be allowed to do?

I’ve often wished for the ability to create a query, and then make just that query available to moderators. Or the ability to have the results of a query sent to me (or another discourse user) on a schedule, along the lines of the user export which is niftily delivered by PM.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2018 年 3 月 27 日午後 3:57 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/4 "2018-03-27T15:57:59Z")

</div>

I don’t know the ETA but AFAIK there are plans to expose Admin vetted queries to Moderators via the dashboard.

I am a moderator at SitePoint, _not_ an admin, so I don’t have access to [Data Explorer](https://meta.discourse.org/t/32566?silent=true) there. I _do_ have access to [Data Explorer](https://meta.discourse.org/t/32566?silent=true) on my localhost installs so I have some experience with what it is able to do.

Although the plugin has safety built in as far as protecting the database, it is very powerful in terms of what data it can provide. Some of which should, IMHO, _not_ be available to any other than an admin. (eg. both personal and private information).

On the other hand, there have been a few times I have petitioned our admin to run a query for me and reply back with the results and he has gracefully obliged.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2018 年 3 月 27 日午後 4:37 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/5 "2018-03-27T16:37:06Z")

</div>

> [@Discourse Data Explorer](https://meta.discourse.org/t/discourse-data-explorer/32566/129):
>
> I don’t know the ETA but AFAIK there are plans to expose Admin vetted queries to Moderators via the dashboard.

The new dashboard is currently planned for this release ([Discourse Version 2.0](https://meta.discourse.org/t/discourse-version-2-0/73729)). Of course that is always subject to change.

What I cannot confirm is if exposing [Data Explorer](https://meta.discourse.org/t/32566?silent=true) queries is planned for the first release of the new dashboard, or if it will wait until a later improvement pass.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018 年 3 月 31 日午前 7:09 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/8 "2018-03-31T07:09:15Z")

</div>

for data analysis, we have a colleague who needs to have access to the user data. he is currently playing with the data to see if he can extract patterns for “topic-user” and “user-user” interactions.

we can user “localhost” or “admin access” in this case as mentioned above, but I was wondering what will happen if moderators have access to the plugin as well. since they **already have access to users information** in the user section of admin panel.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018 年 11 月 17 日午後 10:00 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/9 "2018-11-17T22:00:41Z")

</div>

The plan is for some queries to be marked safe as runnable by staff, but not to expose all of [data explorer](https://meta.discourse.org/t/32566?silent=true) proper.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2018 年 11 月 18 日午後 11:14 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/10 "2018-11-18T23:14:48Z")

</div>

Any chance we can mark queries that we make to be exposed to moderators? I’ve been working on a few things on SP that I wouldn’t mind exposing the data of, as it is meant for their eyes, right now I export/copy it to a topic, which requires manual effort.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018 年 11 月 19 日午前 5:08 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/11 "2018-11-19T05:08:02Z")

</div>

Yes, that is the plan!

---

<div class="post-metadata">

### Author: ![rmdawson71](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rmdawson71/32/106206_2.png) [@rmdawson71](https://meta.discourse.org/u/rmdawson71)
#### Post date: [2019 年 8 月 5 日午後 2:07 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/14 "2019-08-05T14:07:23Z")

</div>

この機能を有効にする現在の状況はどうなっていますか？ 管理者のみがクエリを実行できることを発見した後、このスレッドを見つけました。 当社のフォーラムで進めている作業にとって、いくつかの管理者が検証したクエリへのアクセスがあれば素晴らしいです。

ありがとうございます。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2019 年 8 月 6 日午前 12:46 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/15 "2019-08-06T00:46:10Z")

</div>

より大きな機能を実装したいと考えています。これは私の要望リストには含まれていますが、まだスケジュールには組み込まれていません。

クエリの実行を任意のグループに「公開」できるようにしたいと考えています。クエリの作成は引き続き **管理者のみ** の権限に限定したいと考えており、その方針は変えるつもりはありません。しかし、実行権限については、どのグループでも付与できるようにしたいのです。

これにより、カスタムレポートをモジュール管理ダッシュボードに追加できるなど、さまざまな機能が実現可能になります。これは @j.jaffeux 氏も以前から関心を持っていた機能です。

もしコミュニティの皆さんでこのようなプロジェクトに興味がある方がいらっしゃれば、UX がどのように動作するか、特定のレポートに対してどのように「実行権限を付与」するか、どこでその機能を表示するかといったモックアップのスクリーンショットを投稿してください。そのほかのアイデアも歓迎します。

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [2019 年 8 月 16 日午後 4:56 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/16 "2019-08-16T16:56:21Z")

</div>

この機能に取り組んでみたいです。モックアップのスクリーンショットをいくつか作成しました。

最初のスクリーンショットは、レポートの編集画面です。管理者は、レポート結果のダウンロード権限を持つグループを追加できます。

私にとって最大の疑問は、グループ内のユーザーにレポートをどのように表示するかということです。私の最初の考えは、非管理者ユーザーには JSON と CSV ボタンのみを表示し、レポートがまだ実行されていない場合は実行するが、非管理者がクエリを繰り返し実行するのを防ぐというものです。

@sam この方向性についてどう思いますか？（1 つの投稿に 1 枚の画像しか投稿できないため、別の画像は次の投稿でアップロードします）

 ![discourse-data-explorer-admin](https://global.discourse-cdn.com/meta/original/3X/6/b/6b842d9b05bef512d1de61783dc65d4ad71c8acb.png)

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [2019 年 8 月 16 日午後 4:56 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/17 "2019-08-16T16:56:56Z")

</div>

こちらがもう一枚のスクリーンショットです。このタブは当然、グループのメンバーにのみ表示されます。 -

 ![discourse-data-explorer-non-admin](https://global.discourse-cdn.com/meta/original/3X/7/c/7c78a356d1f925a66e6d2a6d7c67f32d01b7e822.png)

---

<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: [2019 年 8 月 16 日午後 5:13 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/18 "2019-08-16T17:13:24Z")

</div>

> [@markvanlan](#):
>
> 私の最初の考えは、JSON と CSV ボタンを管理者以外のユーザーにのみ表示し、レポートがまだ実行されていない場合に実行できるようにするが、管理者以外のユーザーがクエリを繰り返し実行することを防ぐというものでした。

グループメンバーが Run ボタンにアクセスできるようにするべきだと思います。

その理由は、ユーザーがサイトを再起動するためにクエリを無効化しようとするのを信頼できないなら、そもそもそのユーザーをグループに追加すべきではないからです。ほとんどの場合、データエクスプローラーのクエリは、ダウンロードして他のツールで確認するためではなく、UX 上で役立つために使用されます。また、表示機能は素晴らしいことをしてくれます（例えば、`user_id` や `topic_id` を、データをダウンロードしてから再現するのが難しい便利な方法で表示するなど）。

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [2019 年 8 月 16 日午後 5:27 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/19 "2019-08-16T17:27:31Z")

</div>

なるほどですね。実行機能は、管理者が「実行」ボタンを押した際に表示される内容をそのまま反映し、その結果を以下に表示する形になります。

グループに対して「最終実行時刻」も表示したほうが役立つでしょうか？

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2019 年 8 月 19 日午前 12:26 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/20 "2019-08-19T00:26:45Z")

</div>

グループ内にこれを自然な場所に配置してくれたことを本当に嬉しいです。ただ、これは「アクティビティ」には合わないと思うので、グループページに専用のタブを設けるべきだと思います。

「メッセージ」と「管理」の間に配置するのはどうでしょうか？1 つ以上のレポートがあり、かつあなたがそのグループの明示的なメンバーである場合に、そのタブが表示されるようにします。

そうすれば、作業スペースの横幅も少し広がります。

レポートへのアクセス権を持つ人は、パラメータ付きレポートの場合に「パラメータの追加」を行え、管理者画面と同じ制御で実行できるようにすべきです。SQL を表示するかどうかについては迷っていますが、当面は非表示にしましょう。

権限設定の場所についてですが、管理者ページで目立たない方が好ましいです。まずはそこから始め、テキストは簡潔にしましょう。

このフィードバックに納得がいけば、ぜひ着手してください！

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [2019 年 8 月 19 日午前 1:10 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/21 "2019-08-19T01:10:58Z")

</div>

素晴らしいフィードバックをありがとうございます。すべて理解できましたので、着手いたします。

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [2019 年 8 月 21 日午後 8:31 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/22 "2019-08-21T20:31:44Z")

</div>

@sam さん、  
デフォルトクエリ（プラグインインストール時に既に存在するもの）は編集できません。

私のスクリーンショットでは、クエリをグループに公開する機能はクエリの編集を通じてアクセスされます。デフォルトクエリもグループに公開できるようにすべきでしょうか？

もしそうであれば、両方のタイプのクエリに対応するために、デザインを少し変更する必要があるかもしれません。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2019 年 8 月 21 日午後 9:47 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/23 "2019-08-21T21:47:52Z")

</div>

はい、クエリに関するメタデータ（最終実行日時、実行権限を持つユーザーなど）は専用のテーブルに格納すべきだと考えます。ビルトインクエリについても権限を設定できるようにすべきです（これらは安定した ID を持っています）。

---

<div class="post-metadata">

### Author: ![markvanlan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markvanlan/32/160087_2.png) [@markvanlan](https://meta.discourse.org/u/markvanlan)
#### Post date: [2019 年 9 月 2 日午後 7:30 UTC](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613/24 "2019-09-02T19:30:02Z")

</div>

私が行ったことを共有し、フィードバックをいただきたいと思います。

以下は、クエリ管理インデックスからグループを追加し、その後、非管理者側からクエリを表示した際のスクリーンショットです。

[PR リンク](https://github.com/discourse/discourse-data-explorer/pull/36)

 ![03%20AM](https://global.discourse-cdn.com/meta/original/3X/7/6/76422c1d101e318c8f34439815ac213d87f01311.png)  
 ![14%20AM](https://global.discourse-cdn.com/meta/original/3X/a/1/a10bc7386deb8edd740b1c7e258276205c26b5b6.png)  
 ![27%20AM](https://global.discourse-cdn.com/meta/original/3X/0/0/001da2dfddd555f9a53e763b2b27e4a78d5849d0.png)  
 ![45%20AM](https://global.discourse-cdn.com/meta/original/3X/4/f/4f1be9b8e6f67debe4113012be27447ff28c8b6b.png)  
 ![01%20AM](https://global.discourse-cdn.com/meta/original/3X/8/e/8e082576de553421996909e530ea41dbba4aad7a.png)

[次のページ](https://meta.discourse.org/t/make-data-explorer-available-to-moderators/90613.md?page=2)
