It is the good custom not just in Sri Lanka but everywhere to obtain permission from the people you want to photograph. Most Sri Lankans are willing to have their smiling pictures taken.
Pleas take note: Never turn your back toward a Buddha statue while having your picture taken. That would be a great insult.
It is also customary not to wear shoes and/or any headdress while visitng temple structures. Please follow this advice.
You should be careful in all matters which might touch upon security issues. Airports, sea ports, police stations, broadcasting stations, any military installations or cordoned-off security areas, dams et al. may not be photographed. In the northern and eastern island regions, where terrorist strikes were aimed at these objects during the civil war, the security forces are quite sensitive in that regard.