What is the ruling on exposure and viewing private parts in the absence of one's spouse?

Chapter on Ghusl from Janabah (Major Impurity)

Al-Mughni

Book of Purification

Book 2 · Issue 2 · Bab 9

Open in Qurani

Primary text

It is prohibited for a person to expose their private parts or view the private parts of others unless it is one's spouse or what one's right hand possesses. Even when one is alone, Allah is more deserving of modesty than people are.