get_protection_level function

Protection level calculations