An external access level provider may be utilized when you need to rely on controls and data passports provided by external systems. In order to switch to an external access level provider, the external provider contract must conform to the IAccessLevels interface or an adapter contract that conforms to the interface must be used. Once the external provider contract is deployed, the AppManager must be pointed to the new provider.

Required functions for the External Access Level Provider

    function addLevel(address _address, uint8 _level) external;

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

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

The implementations for each of the above functions can be found in the AccessLevels contract.

see IAccessLevels
see AccessLevels
    function proposeOwner(address _newOwner) external;

    function confirmOwner() external;

    function confirmDataProvider(ProviderType _providerType) external;

The implementations for each of the above functions can be found in the DataModule contract.

see DataModule

Process for switching to an external access level provider

The switching process consists of proposing and confirming the data provider. The first part of the 2 step process is to propose a new access level provider in the AppManager. Once the new provider address is proposed, then it is confirmed by invoking a confirmation function in the new provider that invokes the corresponding function in AppManager. The process is as follows:

    1. Deploy the external Access Level Provider.
    1. Call proposeAccessLevelsProvider in the AppManager.
    function proposeAccessLevelsProvider(address _newProvider) external onlyRole(APP_ADMIN_ROLE);
    
    1. Call confirmDataProvider in the external access level provider contract with provider type = IDataModule.ProviderType.ACCESS_LEVEL:
    function confirmDataProvider(ProviderType _providerType) external;
    

Revert Messages

The confirmation will revert if the external access level contract address does not match the proposed access level provider:

error ConfirmerDoesNotMatchProposedAddress();

The selector for this error is 0x41284967.