Git Source

Inherits: IAccessLevels, DataModule, IAppLevelEvents

Author: @ShaneDuncan602, @oscarsernarosero, @TJ-Everett

Data contract to store AccessLevel Levels for user accounts

This contract stores and serves Access Levels via an internal mapping

State Variables

levels

mapping(address => uint8) public levels;

Functions

constructor

Constructor that sets the app manager address used for permissions. This is required for upgrades.

constructor(address _dataModuleAppManagerAddress) DataModule(_dataModuleAppManagerAddress);

Parameters

NameTypeDescription
_dataModuleAppManagerAddressaddressaddress of the owning app manager

addLevel

Add the Access Level to the account. Restricted to the owner

function addLevel(address _address, uint8 _level) public virtual onlyOwner;

Parameters

NameTypeDescription
_addressaddressaddress of the account
_leveluint8access level(0-4)

addMultipleAccessLevels

Add the Access Level(0-4) to the list of account. Restricted to the owner.

function addMultipleAccessLevels(address[] memory _accounts, uint8[] memory _level) external onlyOwner;

Parameters

NameTypeDescription
_accountsaddress[]address array upon which to apply the Access Level
_leveluint8[]Access Level array to add

addAccessLevelToMultipleAccounts

Add the Access Level(0-4) to multiple accounts. Restricted to the owner.

function addAccessLevelToMultipleAccounts(address[] memory _accounts, uint8 _level) external virtual onlyOwner;

Parameters

NameTypeDescription
_accountsaddress[]addresses upon which to apply the Access Level
_leveluint8Access Level to add

getAccessLevel

Get the Access Level for the account.

function getAccessLevel(address _account) external view virtual returns (uint8);

Parameters

NameTypeDescription
_accountaddressaddress of the account

Returns

NameTypeDescription
<none>uint8level Access Level(0-4)

removeAccessLevel

Remove the Access Level for the account. Restricted to the owner

function removeAccessLevel(address _account) external virtual onlyOwner;

Parameters

NameTypeDescription
_accountaddressaddress of the account