Authorization

Contains interfaces and contracts related to authorization.

Contracts

IAccess

import "@etherisc/gif-next/contracts/authorization/IAccess.sol";

IAuthorization

import "@etherisc/gif-next/contracts/authorization/IAuthorization.sol";
Functions
  • [getTokenHandlerName()]

  • [getTokenHandlerTarget()]

  • [getTargets()]

  • [targetExists(target)]

IServiceAuthorization
  • [getDomain()]

  • [getRelease()]

  • [getCommitHash()]

  • [getMainTargetName()]

  • [getMainTarget()]

  • [getServiceDomains()]

  • [getServiceDomain(idx)]

  • [getServiceTarget(serviceDomain)]

  • [getServiceRole(serviceDomain)]

  • [getServiceAddress(serviceDomain)]

  • [getTargetRole(target)]

  • [roleExists(roleId)]

  • [getRoles()]

  • [getRoleInfo(roleId)]

  • [getRoleName(roleId)]

  • [getAuthorizedRoles(target)]

  • [getAuthorizedFunctions(target, roleId)]

IERC165
  • [supportsInterface(interfaceId)]

getTokenHandlerName() → string name external

Returns the token hander name. Only components have a token handler.

getTokenHandlerTarget() → Str target external

Returns the token hander target. Only components have a token handler.

getTargets() → Str[] targets external

Returns the complete list of targets.

targetExists(Str target) → bool exists external

Returns true iff the specified target exists.

IServiceAuthorization

import "@etherisc/gif-next/contracts/authorization/IServiceAuthorization.sol";
Functions
  • [getDomain()]

  • [getRelease()]

  • [getCommitHash()]

  • [getMainTargetName()]

  • [getMainTarget()]

  • [getServiceDomains()]

  • [getServiceDomain(idx)]

  • [getServiceTarget(serviceDomain)]

  • [getServiceRole(serviceDomain)]

  • [getServiceAddress(serviceDomain)]

  • [getTargetRole(target)]

  • [roleExists(roleId)]

  • [getRoles()]

  • [getRoleInfo(roleId)]

  • [getRoleName(roleId)]

  • [getAuthorizedRoles(target)]

  • [getAuthorizedFunctions(target, roleId)]

IERC165
  • [supportsInterface(interfaceId)]

getDomain() → ObjectType targetDomain external

Returns the main domain of the authorization.

getRelease() → VersionPart release external

Returns the release (VersionPart) for which the authorizations are defined by this contract. Matches with the release returned by the linked service authorization.

getCommitHash() → string commitHash external

Returns the commit hash for the related GIF release.

getMainTargetName() → string name external

Returns the main target id name as string. This name is used to derive the target id and a corresponding target role name Overwrite this function to change the basic pool target name.

getMainTarget() → Str target external

Returns the main target.

getServiceDomains() → ObjectType[] serviceDomains external

Returns the full list of service domains for this release. Services need to be registered for the release in revers order of this list.

getServiceDomain(uint256 idx) → ObjectType serviceDomain external

Returns the service domain for the provided index.

getServiceTarget(ObjectType serviceDomain) → Str serviceTarget external

Returns the service target for the specified domain.

getServiceRole(ObjectType serviceDomain) → RoleId serviceRoleId external

Returns the service target for the specified domain.

getServiceAddress(ObjectType serviceDomain) → address service external

Returns the expected service address for the provided domain.

getTargetRole(Str target) → RoleId roleId external

Returns the role id associated with the target. If no role is associated with the target the zero role id is returned.

roleExists(RoleId roleId) → bool exists external

Returns true iff the role exists.

getRoles() → RoleId[] roles external

Returns the list of involved roles.

getRoleInfo(RoleId roleId) → struct IAccess.RoleInfo roleInfo external

Returns the role info for the provided role id.

getRoleName(RoleId roleId) → string roleName external

Returns the name for the provided role id.

getAuthorizedRoles(Str target) → RoleId[] roleIds external

For the given target the list of authorized role ids is returned

getAuthorizedFunctions(Str target, RoleId roleId) → struct IAccess.FunctionInfo[] authorizatedFunctions external

For the given target and role id the list of authorized functions is returned

IAccessAdmin

import "@etherisc/gif-next/contracts/authorization/IAccessAdmin.sol";

Base interface for registry admin, release admin, and instance admin

Functions
  • [getAuthorization()]

  • [getLinkedNftId()]

  • [isLocked()]

  • [roles()]

  • [getRoleId(idx)]

  • [roleExists(roleId)]

  • [getRoleForName(name)]

  • [getRoleInfo(roleId)]

  • [isRoleActive(roleId)]

  • [isRoleCustom(roleId)]

  • [isRoleMember(roleId, account)]

  • [isRoleAdmin(roleId, account)]

  • [roleMembers(roleId)]

  • [getRoleMember(roleId, idx)]

  • [targetExists(target)]

  • [getTargetForName(name)]

  • [targets()]

  • [getTargetAddress(idx)]

  • [getTargetInfo(target)]

  • [isTargetLocked(target)]

  • [authorizedFunctions(target)]

  • [getAuthorizedFunction(target, idx)]

IRelease
  • [getRelease()]

IRegistryLinked
  • [getRegistry()]

IAccessManaged
  • [authority()]

  • [setAuthority()]

  • [isConsumingScheduledOp()]

Events
  • [LogAccessAdminRoleCreated(admin, roleId, targetType, roleAdminId, name)]

  • [LogAccessAdminTargetCreated(admin, name, managed, target, roleId)]

  • [LogAccessAdminRoleActivatedSet(admin, roleId, active, lastUpdateIn)]

  • [LogAccessAdminRoleGranted(admin, account, roleName)]

  • [LogAccessAdminRoleRevoked(admin, account, roleName)]

  • [LogAccessAdminTargetLockedSet(admin, target, locked, lastUpdateIn)]

  • [LogAccessAdminFunctionGranted(admin, target, func, lastUpdateIn)]

IAccessManaged
  • [AuthorityUpdated(authority)]

getAuthorization() → contract IAuthorization authorization external

getLinkedNftId() → NftId linkedNftId external

isLocked() → bool locked external

roles() → uint256 numberOfRoles external

getRoleId(uint256 idx) → RoleId roleId external

roleExists(RoleId roleId) → bool exists external

getRoleForName(string name) → RoleId roleId, bool exists external

getRoleInfo(RoleId roleId) → struct IAccess.RoleInfo roleInfo external

isRoleActive(RoleId roleId) → bool isActive external

isRoleCustom(RoleId roleId) → bool isCustom external

isRoleMember(RoleId roleId, address account) → bool external

isRoleAdmin(RoleId roleId, address account) → bool external

roleMembers(RoleId roleId) → uint256 numberOfMembers external

getRoleMember(RoleId roleId, uint256 idx) → address account external

targetExists(address target) → bool exists external

getTargetForName(Str name) → address target external

targets() → uint256 numberOfTargets external

getTargetAddress(uint256 idx) → address target external

getTargetInfo(address target) → struct IAccess.TargetInfo targetInfo external

isTargetLocked(address target) → bool locked external

authorizedFunctions(address target) → uint256 numberOfFunctions external

getAuthorizedFunction(address target, uint256 idx) → struct IAccess.FunctionInfo func, RoleId roleId external

LogAccessAdminRoleCreated(string admin, RoleId roleId, enum IAccess.TargetType targetType, RoleId roleAdminId, string name) event

LogAccessAdminTargetCreated(string admin, string name, bool managed, address target, RoleId roleId) event

LogAccessAdminRoleActivatedSet(string admin, RoleId roleId, bool active, Blocknumber lastUpdateIn) event

LogAccessAdminRoleGranted(string admin, address account, string roleName) event

LogAccessAdminRoleRevoked(string admin, address account, string roleName) event

LogAccessAdminTargetLockedSet(string admin, address target, bool locked, Blocknumber lastUpdateIn) event

LogAccessAdminFunctionGranted(string admin, address target, string func, Blocknumber lastUpdateIn) event

AccessAdmin

import "@etherisc/gif-next/contracts/authorization/AccessAdmin.sol";

A generic access amin contract that implements role based access control based on OpenZeppelin’s AccessManager contract. The contract provides read functions to query all available roles, targets and access rights. This contract works for both a constructor based deployment or a deployment based on cloning and initialization.

Functions
  • [initialize(authority, adminName)]

  • [__AccessAdmin_init(authority, adminName)]

  • [getRelease()]

  • [getRegistry()]

  • [getLinkedNftId()]

  • [getAuthorization()]

  • [isLocked()]

  • [roles()]

  • [getRoleId(idx)]

  • [getAdminRole()]

  • [getPublicRole()]

  • [roleExists(roleId)]

  • [getRoleForName(name)]

  • [getRoleInfo(roleId)]

  • [isRoleActive(roleId)]

  • [isRoleCustom(roleId)]

  • [roleMembers(roleId)]

  • [getRoleMember(roleId, idx)]

  • [isRoleMember(roleId, account)]

  • [isRoleAdmin(roleId, account)]

  • [targetExists(target)]

  • [targets()]

  • [getTargetAddress(idx)]

  • [getTargetInfo(target)]

  • [getTargetForName(name)]

  • [isTargetLocked(target)]

  • [authorizedFunctions(target)]

  • [getAuthorizedFunction(target, idx)]

  • [getFunctionInfo(target, selector)]

  • [_linkToNftOwnable(registerable)]

  • [_createRoles(authorization)]

  • [_createRole(roleId, info, revertOnExistingRole)]

  • [_setRoleActive(roleId, active)]

  • [_grantRoleToAccount(roleId, account)]

  • [_revokeRoleFromAccount(roleId, account)]

  • [_getOrCreateTargetRoleIdAndName(target, targetName, targetType)]

  • [_createTarget(target, targetName, targetType, checkAuthority)]

  • [_createTargetUnchecked(target, targetName, targetType, managed)]

  • [_setTargetLocked(target, locked)]

  • [_authorizeFunctions(authorization, target, roleId)]

  • [_authorizeTargetFunctions(target, roleId, functions, onlyComponentOrContractTargets, addFunctions)]

  • [_updateFunctionAccess(target, roleId, func, addFunction)]

AccessManagedUpgradeable
  • [__AccessManaged_init(initialAuthority)]

  • [__AccessManaged_init_unchained(initialAuthority)]

  • [authority()]

  • [setAuthority(newAuthority)]

  • [isConsumingScheduledOp()]

  • [_setAuthority(newAuthority)]

  • [_checkCanCall(caller, data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
IAccessAdmin
  • [LogAccessAdminRoleCreated(admin, roleId, targetType, roleAdminId, name)]

  • [LogAccessAdminTargetCreated(admin, name, managed, target, roleId)]

  • [LogAccessAdminRoleActivatedSet(admin, roleId, active, lastUpdateIn)]

  • [LogAccessAdminRoleGranted(admin, account, roleName)]

  • [LogAccessAdminRoleRevoked(admin, account, roleName)]

  • [LogAccessAdminTargetLockedSet(admin, target, locked, lastUpdateIn)]

  • [LogAccessAdminFunctionGranted(admin, target, func, lastUpdateIn)]

IAccessManaged
  • [AuthorityUpdated(authority)]

Initializable
  • [Initialized(version)]

initialize(address authority, string adminName) public

Initializes this admin with the provided accessManager (and authorization specification). Internally initializes access manager with this admin and creates basic role setup.

__AccessAdmin_init(address authority, string adminName) internal

Initializes this admin with the provided accessManager and name. IMPORTANT - cloning of an access admin and initialization MUST be done in the same tx. - this function as well as any completeSetup functions MUST be called in the same tx.

getRelease() → VersionPart release public

Registers a registry contract for a specified chain. Only one chain registry may be registered per chain

getRegistry() → contract IRegistry registry public

getLinkedNftId() → NftId linkedNftId external

getAuthorization() → contract IAuthorization authorization public

isLocked() → bool locked public

roles() → uint256 numberOfRoles external

getRoleId(uint256 idx) → RoleId roleId external

getAdminRole() → RoleId roleId public

getPublicRole() → RoleId roleId public

roleExists(RoleId roleId) → bool exists public

getRoleForName(string name) → RoleId roleId, bool exists public

getRoleInfo(RoleId roleId) → struct IAccess.RoleInfo public

isRoleActive(RoleId roleId) → bool isActive external

isRoleCustom(RoleId roleId) → bool isActive external

roleMembers(RoleId roleId) → uint256 numberOfMembers external

getRoleMember(RoleId roleId, uint256 idx) → address account external

isRoleMember(RoleId roleId, address account) → bool public

isRoleAdmin(RoleId roleId, address account) → bool public

targetExists(address target) → bool exists public

targets() → uint256 numberOfTargets external

getTargetAddress(uint256 idx) → address target external

getTargetInfo(address target) → struct IAccess.TargetInfo targetInfo public

getTargetForName(Str name) → address target public

isTargetLocked(address target) → bool locked public

authorizedFunctions(address target) → uint256 numberOfFunctions external

getAuthorizedFunction(address target, uint256 idx) → struct IAccess.FunctionInfo func, RoleId roleId external

getFunctionInfo(address target, Selector selector) → struct IAccess.FunctionInfo functionInfo external

_linkToNftOwnable(address registerable) internal

_createRoles(contract IServiceAuthorization authorization) internal

_createRole(RoleId roleId, struct IAccess.RoleInfo info, bool revertOnExistingRole) internal

Creates a role based on the provided parameters. Checks that the provided role and role id and role name not already used.

_setRoleActive(RoleId roleId, bool active) internal

Activates or deactivates role. The role activ property is indirectly controlled over the pausedAt timestamp.

_grantRoleToAccount(RoleId roleId, address account) internal

grant the specified role to the provided account

_revokeRoleFromAccount(RoleId roleId, address account) internal

revoke the specified role from the provided account

_getOrCreateTargetRoleIdAndName(address target, string targetName, enum IAccess.TargetType targetType) → RoleId roleId, string roleName, bool exists internal

_createTarget(address target, string targetName, enum IAccess.TargetType targetType, bool checkAuthority) → RoleId contractRoleId internal

_createTargetUnchecked(address target, string targetName, enum IAccess.TargetType targetType, bool managed) → RoleId targetRoleId internal

Creates a new target and a corresponding contract role. The function assigns the role to the target and logs the creation.

_setTargetLocked(address target, bool locked) internal

_authorizeFunctions(contract IAuthorization authorization, Str target, RoleId roleId) internal

Authorize the functions of the target for the specified role.

_authorizeTargetFunctions(address target, RoleId roleId, struct IAccess.FunctionInfo[] functions, bool onlyComponentOrContractTargets, bool addFunctions) internal

Authorize the functions of the target for the specified role. Flag addFunctions determines if functions are added or removed.

_updateFunctionAccess(address target, RoleId roleId, struct IAccess.FunctionInfo func, bool addFunction) internal

AccessManagerCloneable

import "@etherisc/gif-next/contracts/authorization/AccessManagerCloneable.sol";

An AccessManager based on OpenZeppelin that is cloneable and has a central lock property. The lock property allows to lock all services of a release in a central place. Cloned by upon release preparation and instance cloning.

Modifiers
Functions
  • [initialize(admin)]

  • [completeSetup(registry, release)]

  • [canCall(caller, target, selector)]

  • [setLocked(locked)]

  • [getRelease()]

  • [isLocked()]

  • [_checkAndSetRelease(release)]

  • [_checkAndSetRegistry(registry)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

AccessManagerUpgradeable
  • [__AccessManager_init(initialAdmin)]

  • [__AccessManager_init_unchained(initialAdmin)]

  • [expiration()]

  • [minSetback()]

  • [isTargetClosed(target)]

  • [getTargetFunctionRole(target, selector)]

  • [getTargetAdminDelay(target)]

  • [getRoleAdmin(roleId)]

  • [getRoleGuardian(roleId)]

  • [getRoleGrantDelay(roleId)]

  • [getAccess(roleId, account)]

  • [hasRole(roleId, account)]

  • [labelRole(roleId, label)]

  • [grantRole(roleId, account, executionDelay)]

  • [revokeRole(roleId, account)]

  • [renounceRole(roleId, callerConfirmation)]

  • [setRoleAdmin(roleId, admin)]

  • [setRoleGuardian(roleId, guardian)]

  • [setGrantDelay(roleId, newDelay)]

  • [_grantRole(roleId, account, grantDelay, executionDelay)]

  • [_revokeRole(roleId, account)]

  • [_setRoleAdmin(roleId, admin)]

  • [_setRoleGuardian(roleId, guardian)]

  • [_setGrantDelay(roleId, newDelay)]

  • [setTargetFunctionRole(target, selectors, roleId)]

  • [_setTargetFunctionRole(target, selector, roleId)]

  • [setTargetAdminDelay(target, newDelay)]

  • [_setTargetAdminDelay(target, newDelay)]

  • [setTargetClosed(target, closed)]

  • [_setTargetClosed(target, closed)]

  • [getSchedule(id)]

  • [getNonce(id)]

  • [schedule(target, data, when)]

  • [execute(target, data)]

  • [cancel(caller, target, data)]

  • [consumeScheduledOp(caller, data)]

  • [_consumeScheduledOp(operationId)]

  • [hashOperation(caller, target, data)]

  • [updateAuthority(target, newAuthority)]

MulticallUpgradeable
  • [__Multicall_init()]

  • [__Multicall_init_unchained()]

  • [multicall(data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
IAccessManager
  • [OperationScheduled(operationId, nonce, schedule, caller, target, data)]

  • [OperationExecuted(operationId, nonce)]

  • [OperationCanceled(operationId, nonce)]

  • [RoleLabel(roleId, label)]

  • [RoleGranted(roleId, account, delay, since, newMember)]

  • [RoleRevoked(roleId, account)]

  • [RoleAdminChanged(roleId, admin)]

  • [RoleGuardianChanged(roleId, guardian)]

  • [RoleGrantDelayChanged(roleId, delay, since)]

  • [TargetClosed(target, closed)]

  • [TargetFunctionRoleUpdated(target, selector, roleId)]

  • [TargetAdminDelayUpdated(target, delay, since)]

Initializable
  • [Initialized(version)]

onlyAdminRole() modifier

initialize(address admin) public

completeSetup(address registry, VersionPart release) external

Completes the setup of the access manager. Links the access manager to the registry and sets the release version.

canCall(address caller, address target, bytes4 selector) → bool immediate, uint32 delay public

Returns true if the caller is authorized to call the target with the given selector and the manager lock is not set to locked. Feturn values as in OpenZeppelin AccessManager. For a locked manager the function reverts with ErrorAccessManagerTargetAdminLocked.

setLocked(bool locked) external

Locks/unlocks all services of this access manager. Only the corresponding access admin can lock/unlock the services.

getRelease() → VersionPart release external

Returns the release version of this access manager. For the registry admin release 3 is returned. For the release admin and the instance admin the actual release version is returned.

isLocked() → bool public

Returns true iff all contracts of this access manager are locked.

_checkAndSetRelease(VersionPart release) internal

_checkAndSetRegistry(address registry) internal

Authorization

import "@etherisc/gif-next/contracts/authorization/Authorization.sol";
Functions
  • [constructor(mainTargetName, domain, release, commitHash, targetType, includeTokenHandler)]

  • [getTokenHandlerName()]

  • [getTokenHandlerTarget()]

  • [getTarget(targetName)]

  • [getTargets()]

  • [targetExists(target)]

  • [_setupServiceTargets()]

  • [_setupTargets()]

  • [_setupRoles()]

  • [_setupTokenHandlerAuthorizations()]

  • [_setupTargetAuthorizations()]

  • [_addCustomRole(roleId, adminRoleId, maxMemberCount, name)]

  • [_addGifTarget(contractName)]

  • [_addInstanceTarget(contractName)]

  • [_addTarget(name)]

  • [_toTargetRoleId(targetDomain)]

  • [_toTargetRoleName(targetName)]

ServiceAuthorization
  • [getDomain()]

  • [getRelease()]

  • [getCommitHash()]

  • [getMainTargetName()]

  • [getMainTarget()]

  • [getServiceDomains()]

  • [getServiceDomain(idx)]

  • [getServiceTarget(serviceDomain)]

  • [getServiceRole(serviceDomain)]

  • [getServiceAddress(serviceDomain)]

  • [getTargetRole(target)]

  • [roleExists(roleId)]

  • [getRoles()]

  • [getRoleInfo(roleId)]

  • [getRoleName(roleId)]

  • [getAuthorizedRoles(target)]

  • [getAuthorizedFunctions(target, roleId)]

  • [_setupDomains()]

  • [_setupDomainAuthorizations()]

  • [_authorizeServiceDomain(serviceDomain, serviceAddress)]

  • [_addTargetWithRole(targetName, roleId, roleName)]

  • [_addRole(roleId, info)]

  • [_authorizeForService(serviceDomain, authorizedDomain)]

  • [_authorizeForTarget(target, authorizedRoleId)]

  • [_authorize(functions, selector, name)]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
Initializable
  • [Initialized(version)]

constructor(string mainTargetName, ObjectType domain, uint8 release, string commitHash, enum IAccess.TargetType targetType, bool includeTokenHandler) public

getTokenHandlerName() → string public

Returns the token hander name. Only components have a token handler.

getTokenHandlerTarget() → Str public

Returns the token hander target. Only components have a token handler.

getTarget(string targetName) → Str target public

getTargets() → Str[] targets external

Returns the complete list of targets.

targetExists(Str target) → bool exists external

Returns true iff the specified target exists.

_setupServiceTargets() internal

Sets up the relevant service targets for the component. Overwrite this function for use case specific authorizations.

_setupTargets() internal

Sets up the relevant (non-service) targets for the component. Overwrite this function for use case specific authorizations.

_setupRoles() internal

Sets up the relevant roles for the component. Overwrite this function for use case specific authorizations.

_setupTokenHandlerAuthorizations() internal

Sets up the relevant component’s token handler authorizations. Overwrite this function for use case specific authorizations.

_setupTargetAuthorizations() internal

Sets up the relevant target authorizations for the component. Overwrite this function for use case specific authorizations.

_addCustomRole(RoleId roleId, RoleId adminRoleId, uint32 maxMemberCount, string name) internal

Add a contract role for the provided role id and name.

_addGifTarget(string contractName) internal

Add a gif target with its corresponding contract role

_addInstanceTarget(string contractName) internal

Add an instance target with its corresponding contract role

_addTarget(string name) internal

Use this method to to add an authorized target.

_toTargetRoleId(ObjectType targetDomain) → RoleId targetRoleId internal

Role id for targets registry, staking and instance

_toTargetRoleName(string targetName) → string internal

Returns the role name for the specified target name

ServiceAuthorization

import "@etherisc/gif-next/contracts/authorization/ServiceAuthorization.sol";

Base contract for release specific service authorization contracts and for Authorization contracts.

Functions
  • [constructor(mainTargetName, domain, release, commitHash)]

  • [getDomain()]

  • [getRelease()]

  • [getCommitHash()]

  • [getMainTargetName()]

  • [getMainTarget()]

  • [getServiceDomains()]

  • [getServiceDomain(idx)]

  • [getServiceTarget(serviceDomain)]

  • [getServiceRole(serviceDomain)]

  • [getServiceAddress(serviceDomain)]

  • [getTargetRole(target)]

  • [roleExists(roleId)]

  • [getRoles()]

  • [getRoleInfo(roleId)]

  • [getRoleName(roleId)]

  • [getAuthorizedRoles(target)]

  • [getAuthorizedFunctions(target, roleId)]

  • [_setupDomains()]

  • [_setupDomainAuthorizations()]

  • [_authorizeServiceDomain(serviceDomain, serviceAddress)]

  • [_addTargetWithRole(targetName, roleId, roleName)]

  • [_addRole(roleId, info)]

  • [_authorizeForService(serviceDomain, authorizedDomain)]

  • [_authorizeForTarget(target, authorizedRoleId)]

  • [_authorize(functions, selector, name)]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
Initializable
  • [Initialized(version)]

constructor(string mainTargetName, ObjectType domain, uint8 release, string commitHash) public

getDomain() → ObjectType targetDomain public

Returns the main domain of the authorization.

getRelease() → VersionPart release public

Returns the release (VersionPart) for which the authorizations are defined by this contract. Matches with the release returned by the linked service authorization.

getCommitHash() → string commitHash external

Returns the commit hash for the related GIF release.

getMainTargetName() → string name public

Returns the main target id name as string. This name is used to derive the target id and a corresponding target role name Overwrite this function to change the basic pool target name.

getMainTarget() → Str target external

Returns the main target.

getServiceDomains() → ObjectType[] serviceDomains external

Returns the full list of service domains for this release. Services need to be registered for the release in revers order of this list.

getServiceDomain(uint256 idx) → ObjectType serviceDomain external

Returns the service domain for the provided index.

getServiceTarget(ObjectType serviceDomain) → Str target public

Returns the service target for the specified domain.

getServiceRole(ObjectType serviceDomain) → RoleId serviceRoleId public

Returns the service target for the specified domain.

getServiceAddress(ObjectType serviceDomain) → address service external

Returns the expected service address for the provided domain.

getTargetRole(Str target) → RoleId roleId public

Returns the role id associated with the target. If no role is associated with the target the zero role id is returned.

roleExists(RoleId roleId) → bool exists public

Returns true iff the role exists.

getRoles() → RoleId[] roles external

Returns the list of involved roles.

getRoleInfo(RoleId roleId) → struct IAccess.RoleInfo info external

Returns the role info for the provided role id.

getRoleName(RoleId roleId) → string roleName external

Returns the name for the provided role id.

getAuthorizedRoles(Str target) → RoleId[] roleIds external

For the given target the list of authorized role ids is returned

getAuthorizedFunctions(Str target, RoleId roleId) → struct IAccess.FunctionInfo[] authorizatedFunctions external

For the given target and role id the list of authorized functions is returned

_setupDomains() internal

Defines service domains relevant for the authorization. When used for ReleaseAdmin the list defines the services to be registered for the release. IMPORTANT: Both the list of the service domains as well as the ordering of the domains is important. Trying to register services not in this list or register services in a different order will result in an error.

_setupDomainAuthorizations() internal

Overwrite this function for a specific realease.

_authorizeServiceDomain(ObjectType serviceDomain, address serviceAddress) internal

Use this method to to add an authorized domain. The services will need to be registered in the order they are added using this function.

_addTargetWithRole(string targetName, RoleId roleId, string roleName) internal

Use this method to to add an authorized target together with its target role.

_addRole(RoleId roleId, struct IAccess.RoleInfo info) internal

Use this method to to add an authorized role.

_authorizeForService(ObjectType serviceDomain, ObjectType authorizedDomain) → struct IAccess.FunctionInfo[] authorizatedFunctions internal

Use this method to authorize the specified domain to access the service domain.

_authorizeForTarget(string target, RoleId authorizedRoleId) → struct IAccess.FunctionInfo[] authorizatedFunctions internal

Use this method to authorize the specified role to access the target.

_authorize(struct IAccess.FunctionInfo[] functions, bytes4 selector, string name) internal

Use this method to authorize a specific function authorization