manager should call only by execute

This commit is contained in:
Ricardo Guilherme Schmidt 2018-02-22 05:16:06 -03:00
parent 310f4b8f5a
commit bab9e88c1a

View File

@ -31,11 +31,8 @@ contract Identity is ERC725, ERC735 {
_; _;
} }
modifier managerOrSelf { modifier selfOnly {
require( require(msg.sender == address(this));
isKeyType(bytes32(msg.sender), MANAGEMENT_KEY) ||
msg.sender == address(this)
);
_; _;
} }
@ -68,7 +65,7 @@ contract Identity is ERC725, ERC735 {
uint256 _type uint256 _type
) )
public public
managerOrSelf selfOnly
returns (bool success) returns (bool success)
{ {
_addKey(_key, _purpose, _type); _addKey(_key, _purpose, _type);
@ -80,7 +77,7 @@ contract Identity is ERC725, ERC735 {
uint256 _purpose uint256 _purpose
) )
public public
managerOrSelf selfOnly
returns (bool success) returns (bool success)
{ {
_removeKey(_key, _purpose); _removeKey(_key, _purpose);
@ -140,7 +137,13 @@ contract Identity is ERC725, ERC735 {
} }
function setMiminumApprovalsByKeyType(uint256 _type, uint8 _minimumApprovals) public managerOrSelf { function setMiminumApprovalsByKeyType(
uint256 _type,
uint8 _minimumApprovals
)
public
selfOnly
{
minimumApprovalsByKeyType[_type] = _minimumApprovals; minimumApprovalsByKeyType[_type] = _minimumApprovals;
} }