From eafd19767b98c24abb60c80b976b482d4951e924 Mon Sep 17 00:00:00 2001 From: Matheus Alencar Date: Mon, 19 Nov 2018 11:45:31 -0200 Subject: [PATCH] feat(t2cr): add interface function isPermitted --- contracts/standard/permission/ArbitrableTokenList.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contracts/standard/permission/ArbitrableTokenList.sol b/contracts/standard/permission/ArbitrableTokenList.sol index b8e7c90b..c448eb96 100644 --- a/contracts/standard/permission/ArbitrableTokenList.sol +++ b/contracts/standard/permission/ArbitrableTokenList.sol @@ -142,4 +142,14 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable { arbitrationFeesWaitingTime = _arbitrationFeesWaitingTime; } + /* Public Views */ + + /** @dev Return true if the item is allowed. We consider the item to be in the list if its status is contested and it has not won a dispute previously. + * @param _tokenID The tokenID of the item to check. + * @return allowed True if the item is allowed, false otherwise. + */ + function isPermitted(bytes32 _tokenID) public view returns (bool allowed) { + Item storage item = items[_tokenID]; + return item.status == ItemStatus.Registered || item.status == ItemStatus.ClearingRequested; + } } \ No newline at end of file