Access Control Temporal Revoke Facet
Revokes temporal roles from accounts within a diamond
- Revokes temporal roles from accounts via external functions.
- Utilizes diamond storage for state management.
- Emits
TemporalRoleRevokedevent upon successful revocation. - Protects state-changing functions with access control checks.
Overview
This facet provides functionality to revoke temporal roles assigned to accounts within a Compose diamond. It exposes an external function that interacts with diamond storage to manage role revocations, ensuring that only authorized callers can perform these actions. This facet enables dynamic management of permissions in an upgradeable diamond architecture.
Storage
AccessControlStorage
AccessControlTemporalStorage
State Variables
| Property | Type | Description |
|---|---|---|
ACCESS_CONTROL_STORAGE_POSITION | bytes32 | Diamond storage slot position for this module (Value: keccak256("compose.accesscontrol")) |
TEMPORAL_STORAGE_POSITION | bytes32 | Diamond storage slot position for this module (Value: keccak256("compose.accesscontrol.temporal")) |
Functions
revokeTemporalRole
Revokes a temporal role from an account. Only the admin of the role can revoke it. Emits a TemporalRoleRevoked event. Reverts with AccessControlUnauthorizedAccount If the caller is not the admin of the role.
Parameters:
| Property | Type | Description |
|---|---|---|
_role | bytes32 | The role to revoke. |
_account | address | The account to revoke the role from. |
exportSelectors
Exports the selectors that are exposed by the facet.
Returns:
| Property | Type | Description |
|---|---|---|
- | bytes | Selectors that are exported by the facet. |
Events
Errors
Best Practices
- Ensure the
AccessControlTemporalRevokeFacetis correctly initialized within the diamond's deployment process. - Verify that only the designated admin for a temporal role can call
revokeTemporalRole. - Use
exportSelectorsto understand the facet's ABI and integrate it with diamond facets management.
Security Considerations
The revokeTemporalRole function is protected by access control, reverting with AccessControlUnauthorizedAccount if the caller is not the admin of the specified role. Input validation for _role and _account should be handled by the caller or within the diamond's overall access control strategy. No reentrancy guards are explicitly implemented; follow standard Solidity security practices for external interactions.