original_docstring: Replaces the list of access rules known to the backend storage.
docstring: Replaces the list of access rules known to the backend storage.
docstring_tokens: Replaces the list of access rules known to the backend storage .
code: def update_access(self, share, share_name, rules):
          """Replaces the list of access rules known to the backend storage."""
  
          # Ensure rules are valid
          for rule in rules:
              self._validate_access_rule(rule)
  
          new_rules = {rule['access_to']: rule['access_level'] for rule in rules}
  
          # Get rules from share
          existing_rules = self._get_access_rules(share, share_name)
  
          # Update rules in an order that will prevent transient disruptions
          self._handle_added_rules(share_name, existing_rules, new_rules)
          self._handle_ro_to_rw_rules(share_name, existing_rules, new_rules)
          self._handle_rw_to_ro_rules(share_name, existing_rules, new_rules)
          self._handle_deleted_rules(share_name, existing_rules, new_rules)
code_tokens: def update_access ( self , share , share_name , rules ) : for rule in rules : self . _validate_access_rule ( rule ) new_rules = { rule [ 'access_to' ] : rule [ 'access_level' ] for rule in rules } existing_rules = self . _get_access_rules ( share , share_name ) self . _handle_added_rules ( share_name , existing_rules , new_rules ) self . _handle_ro_to_rw_rules ( share_name , existing_rules , new_rules ) self . _handle_rw_to_ro_rules ( share_name , existing_rules , new_rules ) self . _handle_deleted_rules ( share_name , existing_rules , new_rules )
short_docstring: Replaces the list of access rules known to the backend storage.
short_docstring_tokens: Replaces the list of access rules known to the backend storage .
comment: """Replaces the list of access rules known to the backend storage."""$SEP$# Ensure rules are valid$SEP$# Get rules from share$SEP$# Update rules in an order that will prevent transient disruptions