def can_edit(user, translation, permission):
 if translation.subproject.locked:
  return False
 if (user.is_authenticated() and (not user.email)):
  return False
 if check_owner(user, translation.subproject.project, permission):
  return True
 if (not has_group_perm(user, permission, translation)):
  return False
 if (translation.is_template() and (not has_group_perm(user, 'trans.save_template', translation))):
  return False
 if ((not has_group_perm(user, 'trans.override_suggestion', translation)) and translation.subproject.suggestion_voting and (translation.subproject.suggestion_autoaccept > 0)):
  return False
 return True

def can_edit ( user , translation , permission ) : if translation . subproject . locked : return False if ( user . is_authenticated ( ) and ( not user . email ) ) : return False if check_owner ( user , translation . subproject . project , permission ) : return True if ( not has_group_perm ( user , permission , translation ) ) : return False if ( translation . is_template ( ) and ( not has_group_perm ( user , 'trans.save_template' , translation ) ) ) : return False if ( ( not has_group_perm ( user , 'trans.override_suggestion' , translation ) ) and translation . subproject . suggestion_voting and ( translation . subproject . suggestion_autoaccept > 0 ) ) : return False return True
generic checker for changing translation .