> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/ja/to/permission/custom-roles.md).

# カスタム ロール

## 概要

**カスタム ロール** RealmJoin Portal のオプション機能で、追加の RealmJoin 内部ロールを作成できます。これらのロールには粒度の細かい / 原子的な権限を割り当て、Entra グループまたは専用ユーザーに紐付けることができます。

{% hint style="info" %}
カスタムロールが必要な場合は、 **RealmJoin サポートに有効化を依頼してください**.
{% endhint %}

カスタムロールは JSON として定義されます。RealmJoin Portal に含まれる JSON エディターは構文チェックとハイライトを提供し、カスタムロール JSON スキーマに照らして定義を検証します。

<figure><img src="/files/a73478e0172839507407a29a0fe9f4cb9deb9229" alt=""><figcaption><p>カスタムロール JSON エディター</p></figcaption></figure>

## エディターの使い方

### 構文チェック / エラー

エディターは入力中に構文をチェックします。構文エラーが検出されると、エラーメッセージ **x 件のエラーを表示** とバグアイコンが **保存。**

<figure><img src="/files/dba22c9ea20cb7330fc6118b2c1b3d56bbb5f6f1" alt=""><figcaption><p>JSON エラーメッセージ/ボタン</p></figcaption></figure>

このメッセージをクリックすると、エラーの詳細が表示されます。

### フォーマット

JSON は **フォーマット** ページ右上の隅で

<figure><img src="/files/e49ddea8be3e80a153def9aca08aa8d9392e75d8" alt=""><figcaption><p>［フォーマット］ボタン</p></figcaption></figure>

### 自動補完

エディターは、スキーマから既知のキーワード（permissions など）を自動補完として提示できます。

<figure><img src="/files/b79492dcfffaba8d2f04b7316af4910f63552663" alt=""><figcaption><p>キーワードの自動補完</p></figcaption></figure>

いつでも「Ctrl」+「Space」を押して自動補完を呼び出せます。

## ルール

ロールは、権限と、その権限が付与されるユーザーおよび/またはグループの組み合わせとして記述されます。

ロールは、キーワード **ルール**.

ルールの例:

```json
{
  "Rules": [
    {
      "Name": "既定: Supporter はプライマリユーザーを変更できます [27e589a7]",
      "Description": "Supporter グループのメンバーが RealmJoin に参加済みデバイスのプライマリユーザーを変更できるようにする既定のルールです。名前に含まれている ID はそのまま保持してください。",
      "Groups": [
        "f31f5765-f56f-47fa-9248-ac2d77221634",
        "422e6b7c-bd99-4082-be1c-88cbc2bb2734"
      ],
      "Permissions": [
        "CanChangeRealmJoinPrimaryUser"
      ]
    },{
      "Name": "John が新しい Self Service Forms を追加できるようにする",
      "Users": [
        "b31f5765-f56f-47fa-9248-ac2d77221622"
      ],
      "Permissions": [
        "CanAddSelfServiceForms"
      ]
    }
  ]
}
```

### 名前と説明

**名前** が必要です。 **説明** は任意です。

どちらもプレーンテキストフィールド（文字列）です。

### 権限

権限は、RealmJoin Portal 内の特定のアクションを識別する一意の文字列です。 **権限** は権限のリスト（配列）です。

参照 [利用可能な権限](/ja/to/permission/custom-roles/available-permissions.md) 一般的な権限の一覧と説明については、

### グループ

Entra グループのオブジェクト ID のリスト（配列）です。与えられた [権限](#permissions) は、これらのグループのメンバーであるすべてのユーザーに割り当てられます。

### ユーザー

Entra ユーザーのオブジェクト ID のリスト（配列）です。与えられた [権限](#permissions) は、これらのユーザーに割り当てられます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.realmjoin.com/ja/to/permission/custom-roles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
