Git Source

Inherits: [FacetUtils](/v2(/v2/reference/engine/facets/FacetUtils.sol/contract.FacetUtils)

Author: @mpetersoCode55, @ShaneDuncan602, @TJ-Everett, @VoR0220

This contract is a critical component of the Rules Engine, enabling secure and flexible access control.

This contract contains all the access modifiers used across the Rules Engine. These modifiers enforce role-based access control for various operations, ensuring that only authorized users can execute specific functions. It is inherited by all Engine facets to provide consistent access control mechanisms.

Functions

policyAdminOnly

Ensures that the function caller is a Policy Admin for the specified policy.

This modifier checks if the caller has the Policy Admin role for the given policy ID by delegating the check to another facet. If the caller is not authorized, the transaction is reverted.

modifier policyAdminOnly(uint256 _policyId, address _address);

Parameters

NameTypeDescription
_policyIduint256The ID of the policy to check.
_addressaddressThe address of the user to verify.

callingContractAdminOnly

Ensures that the function caller is a Calling Contract Admin for the specified contract.

This modifier checks if the caller has the Calling Contract Admin role for the given contract address by delegating the check to another facet. If the caller is not authorized, the transaction is reverted.

modifier callingContractAdminOnly(address _callingContract, address _address);

Parameters

NameTypeDescription
_callingContractaddressThe address of the calling contract to check.
_addressaddressThe address of the user to verify.