I have a Smart contract where I want only the onwer to call a specific function, for example:
function getInfo() view public onlyOwner() returns (address) {
return msg.sender;
}
.....
modifier onlyOwner () {
require ( msg.sender== my_owner);
}
I can build a web3 call slaiming to be (calling from) any address, in this case the owner of the contract, for example:
web3 = new Web3(App.web3Provider);
......
if(directAccessMode)
web3.eth.defaultAccount = '0x1111111111111111111111111111111111111111';
......
and be able to geth the required information without any check from EVM that I am really the 'owner' of the address I am claiming to be even avoiding using the address' access details.
I am aware that smart contract data is public nevertheless I do not understnad why there is no control on caller's address validity.
Thanks