Add ACL interface

This commit is contained in:
lash 2023-08-03 15:16:33 +01:00
parent b9a29b7827
commit db35d389ec
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 74 additions and 0 deletions

View File

@ -47,6 +47,27 @@ in CIC native interfaces.
## Native interfaces
### ACL
A simple Access Control List definition that returns true of false
depending on whether an signatory (address) is allowed to operate in a
given context.
#### ERC165 Interface identifier
3ef25013
#### Solidity interface definition
interface IACL {
// Returns true if the address has permission to operate in the given context.
function have(address _address) external view returns(bool);
}
#### Example implementation
<git://holbrook.no/eth-accounts-index.git>
### Accounts Index
Append-only list of addresses. Typically used for access control lists.
@ -83,6 +104,7 @@ b7bca625
function add(address) external returns (bool);
// Verify that the entry exists in the index.
// Implements ACL
function have(address) external view returns (bool);
// Retrieve the timestamp when account was added.

17
doc/texinfo/acl.sol.texi Normal file
View File

@ -0,0 +1,17 @@
@subsection ACL
A simple Access Control List definition that returns true of false depending on whether an signatory (address) is allowed to operate in a given context.
@subsubsection ERC165 Interface identifier
@include ../../build/ACL.interface
@subsubsection Solidity interface definition
@include ../../build/contract_ACL.texi
@subsubsection Example implementation
@uref{git://holbrook.no/eth-accounts-index.git,}

View File

@ -50,6 +50,8 @@ The following well-known solidity interfaces are partially implemented in CIC na
@section Native interfaces
@include acl.sol.texi
@include accountsindex.sol.texi
@include burner.sol.texi

View File

@ -47,6 +47,27 @@ in CIC native interfaces.
## Native interfaces
### ACL
A simple Access Control List definition that returns true of false
depending on whether an signatory (address) is allowed to operate in a
given context.
#### ERC165 Interface identifier
3ef25013
#### Solidity interface definition
interface IACL {
// Returns true if the address has permission to operate in the given context.
function have(address _address) external view returns(bool);
}
#### Example implementation
<git://holbrook.no/eth-accounts-index.git>
### Accounts Index
Append-only list of addresses. Typically used for access control lists.
@ -83,6 +104,7 @@ b7bca625
function add(address) external returns (bool);
// Verify that the entry exists in the index.
// Implements ACL
function have(address) external view returns (bool);
// Retrieve the timestamp when account was added.

10
solidity/ACL.sol Normal file
View File

@ -0,0 +1,10 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 1
interface IACL {
// Returns true if the address has permission to operate in the given context.
function have(address _address) external view returns(bool);
}

View File

@ -20,6 +20,7 @@ interface IAccountsIndex {
function add(address) external returns (bool);
// Verify that the entry exists in the index.
// Implements ACL
function have(address) external view returns (bool);
// Retrieve the timestamp when account was added.