There's so much information missing from your question, it makes it very difficult to give a good answer. What's in the cabinet? How big is the cabinet? What is the environment like around the cabinet?
I agree that it's probably okay (technically) to do it, but it could also be a huge liability safety-wise. People and tools could possibly fall into the cabinet and cause a fault, or be electrocuted. It could fill with water or debris. People could rest things on the lid, deforming the cabinet or making it a maintenance headache to get it open again.