{"record":{"id":"a338422ad312fe5a","repo":"BerriAI/litellm","slug":"team-members-cannot-assign-access-groups-to-keys-f","errorCode":null,"errorMessage":"Team members cannot assign access groups to keys for team {team_table.team_id}. Ask a team or proxy admin to enable the '/key/access_group_assignment' team member permission to allow this.","messagePattern":"Team members cannot assign access groups to keys for team (.+?)\\. Ask a team or proxy admin to enable the '/key/access_group_assignment' team member permission to allow this\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_helpers/team_member_permission_checks.py","lineNumber":198,"sourceCode":"        team_member_object: Final = _get_user_in_team(team_table=team_table, user_id=user_api_key_dict.user_id)\n\n        # Team admins always bypass (consistent with other member-permission checks).\n        if team_member_object is not None and team_member_object.role == \"admin\":\n            return\n\n        permissions: Final = (\n            TeamMemberPermissionChecks._get_list_of_route_enum_as_str(\n                TeamMemberPermissionChecks.get_permissions_for_team_member(\n                    team_member_object=team_member_object,\n                    team_table=team_table,\n                )\n            )\n            if team_member_object is not None\n            else []\n        )\n\n        if KeyManagementRoutes.KEY_ACCESS_GROUP_ASSIGNMENT.value not in permissions:\n            raise HTTPException(\n                status_code=403,\n                detail=(\n                    \"Team members cannot assign access groups to keys for team \"\n                    f\"{team_table.team_id}. Ask a team or proxy admin to enable the \"\n                    f\"'{KeyManagementRoutes.KEY_ACCESS_GROUP_ASSIGNMENT.value}' team \"\n                    \"member permission to allow this.\"\n                ),\n            )\n\n    @staticmethod\n    async def user_belongs_to_keys_team(\n        user_api_key_dict: UserAPIKeyAuth,\n        existing_key_row: LiteLLM_VerificationToken,\n    ) -> bool:\n        \"\"\"\n        Returns True if the user belongs to the team that the key is assigned to\n        \"\"\"\n        from litellm.proxy.management_endpoints.key_management_endpoints import (","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_helpers/team_member_permission_checks.py#L180-L216","documentation":"Error \"Team members cannot assign access groups to keys for team {team_table.team_id}. Ask a team or proxy admin to enable the '/key/access_group_assignment' team member permission to allow this.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_helpers/team_member_permission_checks.py:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ask a team or proxy admin to enable the '/key/access_group_assignment' team member permission, or have an admin assign the access groups."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}