code: def _remove_rule(self, group, role, value=None):
          
          if role not in group:
              return
  
          if value is None:
              group.pop(role, None)
          else:
              group[role].remove(value)
  
          self.invalidate()
docs: Implementation detail