# PolicyRolesBlock

This block allows the user to select a role or a group.

### Properties

| Block Property    | Definition                                                                        | Example Input                                   | Status |
| ----------------- | --------------------------------------------------------------------------------- | ----------------------------------------------- | ------ |
| type              | A block which determines a role for the user.                                     | **PolicyRolesBlock** (Can't be changed).        |        |
| tag               | Unique name for the logic block.                                                  | choose\_role.                                   |        |
| permissions       | Which entity has rights to interact at this part of the workflow.                 | Installer.                                      |        |
| defaultActive     | Shows whether this block is active at this time and whether it needs to be shown. | Checked or unchecked.                           |        |
| roles             | Available roles from which the user can choose.                                   | Select the appropriate roles from the dropdown. |        |
| Available Roles   | list of roles for selected user                                                   | Checked or unchecked.                           |        |
| ·Available Groups | list of groups for selected user                                                  | Checked or unchecked.                           |        |

{% hint style="info" %}
**Note: ‘*****Available Groups*****’** option takes priority and thus, when set, causes the system to ignore **‘*****Available Roles*****’**.
{% endhint %}

{% hint style="info" %}
**Note:** Setting the Permissions property to ‘**No Role’** limits the visibility of this block to those users which have not yet selected a role or a group.
{% endhint %}

{% hint style="info" %}
RefreshEvents are used to refreshing the UI, instead of "dependencies" property.
{% endhint %}

### UI Properties

| UI Property | Definition                                   |
| ----------- | -------------------------------------------- |
| Title       | Provide the a title for the role selector.   |
| Description | Provide a description on the role selection. |

### Events

| Property Name | Name in JSON | Property Value                                                    | Value in JSON                          | Description                                                                                                                     |
| ------------- | ------------ | ----------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Event Type    | -            | <p>Input Event</p><p>Output Event</p>                             | -                                      | Type of the event - determines whether this is ingress or egress event for the current block.                                   |
| Source        | "source"     | Block tag(string)                                                 | "block\_tag"                           | The block which initiates the event.                                                                                            |
| Target        | "target"     | Block tag(string)                                                 | "block\_tag"                           | The block which receives the event.                                                                                             |
| Output Event  | "output"     | Event name(string)                                                | "event\_name"                          | Action or issue that caused the event.                                                                                          |
| Input Event   | "input"      | Event name(string)                                                | "event\_name"                          | Action which will be triggered by the event.                                                                                    |
| Event Actor   | "actor"      | <p>Event Initiator</p><p>Document Owner</p><p>Document Issuer</p> | <p>""</p><p>"owner"</p><p>"issuer"</p> | Allows to transfer control of the block (execution context) to another user. Empty field leaves control at the Event Initiator. |
| Disabled      | "disabled"   | True/False                                                        | true/false                             | Allows to disable the event without deleting it.                                                                                |

To know more information about events, please look at [Events](/guardian-dev/guardian/standard-registry/policies/policy-creation/introduction/events.md).

### API Parameters

<mark style="color:blue;">`GET`</mark> `/policies/{policyId}/blocks/{uuid}`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| policyId<mark style="color:red;">\*</mark> | String | PolicyID    |
| uuid<mark style="color:red;">\*</mark>     | String | Block UUID  |

{% tabs %}
{% tab title="200: OK Successful Operation" %}

```javascript
 {
  "roles": [],
  "groups": [
    "VVBs",
    "Project_Proponent"
  ],
  "groupMap": {
    "VVBs": {
      "groupAccessType": "Private",
      "groupRelationshipType": "Multiple"
    },
    "Project_Proponent": {
      "groupAccessType": "Private",
      "groupRelationshipType": "Single"
    }
  },
  "isMultipleGroups": true,
  "uiMetaData": {
    "title": "Roles",
    "description": "Choose Roles"
  }
}

```

{% endtab %}
{% endtabs %}

<mark style="color:green;">`POST`</mark> `/policies/{policyId}/blocks/{uuid}`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| policyId<mark style="color:red;">\*</mark> | String | Policy ID   |
| uuid<mark style="color:red;">\*</mark>     | String | Block UUID  |

#### Request Body

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| role<mark style="color:red;">\*</mark> | String |             |
| invitation                             | String | Invite Code |
| Group                                  | String | Group Name  |


---

# Agent Instructions: 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:

```
GET https://guardian.hedera.com/guardian-dev/guardian/standard-registry/policies/policy-creation/introduction/roles-workflow-block.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
