There is my code. getRight function doesn't return data when I run this code with injected web3 metamask but it returns data when I run it with JavaScript VM. I did it find where is the problem in order to fix it.
pragma experimental ABIEncoderV2;
contract AccessControlManagment
{
string idReq;
string actionn;
string idRes;
struct right {
string idRequester;
string idResource;
string action;
}
function addReq(string memory id) public{
idReq =id;
}
function addRes(string memory id) public{
idRes =id;
}
function addRight(string memory idRequester,string memory idResource, string memory action) public{
right memory r = right(idRequester,idResource,action);
idReq =idRequester;
idRes =idResource;
actionn = action;
}
function getidReq() public returns (string memory){
return idReq;
}
function getidRes() public returns (string memory){
return idRes;
}
function getaction() public returns (string memory)
{
return actionn;
}
function getRight() public returns (string memory, string memory,string memory) {
return (idReq,idRes,actionn);
}
}