{"record":{"id":"59bd0b24b1ffb560","repo":"getredash/redash","slug":"can-t-modify-built-in-groups","errorCode":null,"errorMessage":"Can't modify built-in groups.","messagePattern":"Can't modify built-in groups\\.","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"redash/handlers/groups.py","lineNumber":38,"sourceCode":"\n    def get(self):\n        if self.current_user.has_permission(\"admin\"):\n            groups = models.Group.all(self.current_org)\n        else:\n            groups = models.Group.query.filter(models.Group.id.in_(self.current_user.group_ids))\n\n        self.record_event({\"action\": \"list\", \"object_id\": \"groups\", \"object_type\": \"group\"})\n\n        return [g.to_dict() for g in groups]\n\n\nclass GroupResource(BaseResource):\n    @require_admin\n    def post(self, group_id):\n        group = models.Group.get_by_id_and_org(group_id, self.current_org)\n\n        if group.type == models.Group.BUILTIN_GROUP:\n            abort(400, message=\"Can't modify built-in groups.\")\n\n        group.name = request.json[\"name\"]\n        models.db.session.commit()\n\n        self.record_event({\"action\": \"edit\", \"object_id\": group.id, \"object_type\": \"group\"})\n\n        return group.to_dict()\n\n    def get(self, group_id):\n        if not (self.current_user.has_permission(\"admin\") or int(group_id) in self.current_user.group_ids):\n            abort(403)\n\n        group = models.Group.get_by_id_and_org(group_id, self.current_org)\n\n        self.record_event({\"action\": \"view\", \"object_id\": group_id, \"object_type\": \"group\"})\n\n        return group.to_dict()\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/getredash/redash/blob/ca79fe988d81cdac9675b412f3dfcab107bc1fbc/redash/handlers/groups.py#L20-L56","documentation":"Raised by GroupResource.post in redash/handlers/groups.py when an admin tries to rename a built-in group (type == Group.BUILTIN_GROUP, i.e. the default/admin/limited built-in groups). Built-in groups' names are fixed by Redash and cannot be edited.","triggerScenarios":"POST /api/groups/<id> with {\"name\": ...} where <id> identifies a built-in group such as 'default' or 'admin' in that org.","commonSituations":"Automated group-management scripts iterating all groups and attempting renames; admin UI attempts to reorganize built-in groups into a naming scheme.","solutions":["Skip groups whose type is 'builtin' in any rename automation; create a new custom group instead.","If a different name is needed, create a new group with the desired name and move members.","Check group type via GET /api/groups/<id> before posting changes."],"exampleFix":"# before\nfor g in client.get('/api/groups')['results']:\n    client.post(f\"/api/groups/{g['id']}\", json={'name': new_name})\n\n# after\nfor g in client.get('/api/groups')['results']:\n    if g['type'] != 'builtin':\n        client.post(f\"/api/groups/{g['id']}\", json={'name': new_name})","handlingStrategy":"validation","validationCode":"g = client.get(f'/api/groups/{gid}')\nif g['type'] == 'builtin':\n    skip_rename(gid)","typeGuard":"def is_builtin_group(group: dict) -> bool:\n    return group.get('type') == 'builtin'","tryCatchPattern":null,"preventionTips":["Model built-in groups as immutable in your tooling.","Fetch group metadata before any write to groups."],"tags":["redash","groups","permissions","bad-request","builtin"],"backgroundTag":"immutable-builtin-resource","analyzedSha":"ca79fe988d81cdac9675b412f3dfcab107bc1fbc","analyzedAt":"2026-08-28T18:32:34.637Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}