parameters: (self, model, mode, group_ids)
return_statement: return bool(self._cr.rowcount)
docstring: Check if a specific group has the access mode to the specified model
docstring_summary: Check if a specific group has the access mode to the specified model
docstring_tokens: Check if a specific group has the access mode to the specified model
function: def check_group(self, model, mode, group_ids):
          """ Check if a specific group has the access mode to the specified model"""
          assert mode in ('read', 'write', 'create', 'unlink'), 'Invalid access mode'
  
          if isinstance(model, models.BaseModel):
              assert model._name == 'ir.model', 'Invalid model object'
              model_name = model.name
          else:
              model_name = model
  
          if isinstance(group_ids, int):
              group_ids = [group_ids]
  
          query = """ SELECT 1 FROM ir_model_access a
                      JOIN ir_model m ON (m.id = a.model_id)
                      WHERE a.active AND a.perm_{mode} AND
                          m.model=%s AND (a.group_id IN %s OR a.group_id IS NULL)
                  """.format(mode=mode)
          self._cr.execute(query, (model_name, tuple(group_ids)))
          return bool(self._cr.rowcount)
function_tokens: def check_group ( self , model , mode , group_ids ) : assert mode in ( 'read' , 'write' , 'create' , 'unlink' ) , 'Invalid access mode' if isinstance ( model , models . BaseModel ) : assert model . _name == 'ir.model' , 'Invalid model object' model_name = model . name else : model_name = model if isinstance ( group_ids , int ) : group_ids = [ group_ids ] query = """ SELECT 1 FROM ir_model_access a
                      JOIN ir_model m ON (m.id = a.model_id)
                      WHERE a.active AND a.perm_{mode} AND
                          m.model=%s AND (a.group_id IN %s OR a.group_id IS NULL)
                  """ . format ( mode = mode ) self . _cr . execute ( query , ( model_name , tuple ( group_ids ) ) ) return bool ( self . _cr . rowcount )