> ## Documentation Index
> Fetch the complete documentation index at: https://thrackle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ExampleUserAccessControl

[Git Source](https://github.com/forte-service-company-ltd/forte-rules-engine/blob/1f7450a94147e76e3930c235a18534779130abee/src/example/ExampleUserAccessControl.sol)

**Inherits:**
[RulesEngineClient](/v2/reference/client/RulesEngineClient.sol/abstract.RulesEngineClient), AccessControl

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

SPDX-License-Identifier: BUSL-1.1

This contract is intended for testing and demonstration purposes to showcase the Rules Engine's capabilities.

*This contract demonstrates how to integrate the Rules Engine with an external contract. It provides an example
of using the Rules Engine to enforce policies on a generic `transfer` function. The contract also includes
role-based access control using OpenZeppelin's AccessControl.*

## State Variables

### CALLING\_CONTRACT\_ADMIN

```solidity
bytes32 constant CALLING_CONTRACT_ADMIN = "Calling_Contract_Admin";
```

## Functions

### constructor

Constructor for the Example User Access Control contract.

*Grants the Calling Contract Admin role to the specified address.*

```solidity
constructor(address callingContractAdmin);
```

**Parameters**

| Name                   | Type      | Description                                                 |
| ---------------------- | --------- | ----------------------------------------------------------- |
| `callingContractAdmin` | `address` | The address to be assigned the Calling Contract Admin role. |

### transfer

Demonstrates a generic `transfer` function integrated with the Rules Engine.

*This function sends custom arguments to the Rules Engine for policy enforcement. The Rules Engine determines
whether the transfer is allowed based on the provided arguments.*

```solidity
function transfer(address to, uint256 value) public returns (bool);
```

**Parameters**

| Name    | Type      | Description             |
| ------- | --------- | ----------------------- |
| `to`    | `address` | The recipient address.  |
| `value` | `uint256` | The amount to transfer. |

**Returns**

| Name     | Type   | Description                                                                |
| -------- | ------ | -------------------------------------------------------------------------- |
| `<none>` | `bool` | bool True if the transfer is allowed by the Rules Engine, false otherwise. |
