Added functionality to check whether locked by own session for update or destroy.