# Permissions

> Permissions

_This contracts provides extending-contracts with role-based access control mechanisms_

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

_Default admin role for all roles. Only accounts with this role can grant/revoke other roles._

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

Returns the admin role that controls the specified role.

_See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}._

#### Parameters

| Name | Type    | Description                                                  |
| ---- | ------- | ------------------------------------------------------------ |
| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER\_ROLE") |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

Grants a role to an account, if not previously granted.

_Caller must have admin role for the `role`. Emits {RoleGranted Event}._

#### Parameters

| Name    | Type    | Description                                                  |
| ------- | ------- | ------------------------------------------------------------ |
| role    | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER\_ROLE") |
| account | address | Address of the account to which the role is being granted.   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

Checks whether an account has a particular role.

_Returns `true` if `account` has been granted `role`._

#### Parameters

| Name    | Type    | Description                                                  |
| ------- | ------- | ------------------------------------------------------------ |
| role    | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER\_ROLE") |
| account | address | Address of the account for which the role is being checked.  |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### hasRoleWithSwitch

```solidity
function hasRoleWithSwitch(bytes32 role, address account) external view returns (bool)
```

Checks whether an account has a particular role; role restrictions can be swtiched on and off.

_Returns `true` if `account` has been granted `role`. Role restrictions can be swtiched on and off: - If address(0) has ROLE, then the ROLE restrictions don't apply. - If address(0) does not have ROLE, then the ROLE restrictions will apply._

#### Parameters

| Name    | Type    | Description                                                  |
| ------- | ------- | ------------------------------------------------------------ |
| role    | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER\_ROLE") |
| account | address | Address of the account for which the role is being checked.  |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

Revokes role from the account.

_Caller must have the `role`, with caller being the same as `account`. Emits {RoleRevoked Event}._

#### Parameters

| Name    | Type    | Description                                                  |
| ------- | ------- | ------------------------------------------------------------ |
| role    | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER\_ROLE") |
| account | address | Address of the account from which the role is being revoked. |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

Revokes role from an account.

_Caller must have admin role for the `role`. Emits {RoleRevoked Event}._

#### Parameters

| Name    | Type    | Description                                                  |
| ------- | ------- | ------------------------------------------------------------ |
| role    | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER\_ROLE") |
| account | address | Address of the account from which the role is being revoked. |

## Events

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |
