contract Linkable is Ownable {
	address[] linked;

	modifier onlyLinked() {
		require(checkPermissions() == true);
		_;
	}
	
	/*
	 * RESTRICTED
	 * Link an address to this contract. This address has access to
	 * any `onlyLinked` function
	 */
	function link(address _address) public onlyOwner {
		linked.push(_address);
	}

	/* 
	 * PUBLIC
	 * Check if you have been linked to this contract
	 */
	function checkPermissions() public view returns (bool) {
		for (uint i = 0; i < linked.length; i++)
			if (linked[i] == msg.sender) return true;
		return false;
	}
}
function link(address _address) public onlyOwner {
	linked.push(_address);
}

/*
 	 * RESTRICTED
 	 * Link an address to this contract. This address has access to
 	 * any `onlyLinked` function
 	 */