I have this mapping
mapping(bytes32 => address[]) public authorisation;
This maps a hash with a list of authorised users.
I have a function to add, and confirm - these work and its not an issue. But now I need to add a delete funciton, where given a hash and an address, that address is revoked access/permission
function deletePermission(bytes32 hash, address user) public {// get index of element with the address = user, then delete this element from the array.}
I already looked over here but didn't find any solutions where the index isn't known. I know you can loop through the array until you find the element matching the address but that would be very costly( in terms of gas). Is there any more efficient way to do it? Thanks