Appearance
Solidity API
IPropsAccessControl
Interface for the PropsAccessControl contract, defining role-based access control functions
This interface provides methods for managing roles and permissions within the system
isDiamondOwner
solidity
function isDiamondOwner(address account) external view returns (bool)Checks if an account is the diamond owner
This function verifies if the given account has the highest level of access
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address of the account to check |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | bool True if the account is the diamond owner, false otherwise |
grantRole
solidity
function grantRole(bytes32 role, address account) externalGrants a role to an account
This function assigns a specific role to the given account
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to grant |
| account | address | The address of the account to receive the role |
hasRole
solidity
function hasRole(bytes32 role, address account) external view returns (bool)Checks if an account has a specific role
This function verifies if the given account has been granted a particular role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to check |
| account | address | The address of the account to check |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | bool True if the account has the role, false otherwise |
hasMinimumRole
solidity
function hasMinimumRole(bytes32 role) external view returns (bool)Checks if the caller has at least the specified role
This function verifies if the calling account has the specified role or a higher-level role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the minimum role to check |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | bool True if the caller has at least the specified role, false otherwise |
getRoleAdmin
solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)Returns the admin role for a specified role
This function retrieves the identifier of the role that can manage the given role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to check |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes32 | bytes32 The identifier of the admin role |
revokeRole
solidity
function revokeRole(bytes32 role, address account) externalRevokes a role from an account
This function removes a specific role from the given account
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to revoke |
| account | address | The address of the account to revoke the role from |
renounceRole
solidity
function renounceRole(bytes32 role) externalAllows an account to renounce a role
This function allows the calling account to give up a role it possesses
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to renounce |
getRoleMember
solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)Returns a role member by index
This function retrieves the address of an account that has been granted a specific role, based on its index
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to check |
| index | uint256 | The index of the member within the role's list of members |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | address | address The address of the role member |
getRoleMemberCount
solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)Returns the number of accounts that have a specific role
This function counts how many accounts have been granted a particular role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to check |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | uint256 The number of accounts with the role |
setRoleAdmin
solidity
function setRoleAdmin(bytes32 role, bytes32 adminRole) externalSets the admin role for a specified role
This function changes which role is responsible for managing another role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to set the admin for |
| adminRole | bytes32 | The identifier of the new admin role |
checkRole
solidity
function checkRole(bytes32 role) external viewChecks if the caller has a specific role
This function verifies if the calling account has been granted a particular role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to check |
checkRole
solidity
function checkRole(bytes32 role, address account) external viewChecks if an account has a specific role
This function verifies if the given account has been granted a particular role
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to check |
| account | address | The address of the account to check |