diff --git a/README.md b/README.md index 6def7fe..6250bfe 100644 --- a/README.md +++ b/README.md @@ -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 + + + ### 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. diff --git a/doc/texinfo/acl.sol.texi b/doc/texinfo/acl.sol.texi new file mode 100644 index 0000000..1811f3c --- /dev/null +++ b/doc/texinfo/acl.sol.texi @@ -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,} + + diff --git a/doc/texinfo/overview.texi b/doc/texinfo/overview.texi index 8751c43..9f6b9c5 100644 --- a/doc/texinfo/overview.texi +++ b/doc/texinfo/overview.texi @@ -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 diff --git a/python/README.md b/python/README.md index 6def7fe..6250bfe 100644 --- a/python/README.md +++ b/python/README.md @@ -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 + + + ### 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. diff --git a/solidity/ACL.sol b/solidity/ACL.sol new file mode 100644 index 0000000..a2c3b5d --- /dev/null +++ b/solidity/ACL.sol @@ -0,0 +1,10 @@ +pragma solidity >=0.6.12; + +// Author: Louis Holbrook 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); +} diff --git a/solidity/AccountsIndex.sol b/solidity/AccountsIndex.sol index ee9dd0f..60719a0 100644 --- a/solidity/AccountsIndex.sol +++ b/solidity/AccountsIndex.sol @@ -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.