{"record":{"id":"c7987b83170718e1","repo":"fastapi/full-stack-fastapi-template","slug":"the-user-doesn-t-have-enough-privileges","errorCode":null,"errorMessage":"The user doesn't have enough privileges","messagePattern":"The user doesn't have enough privileges","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"backend/app/api/deps.py","lineNumber":54,"sourceCode":"    except InvalidTokenError, ValidationError:\n        raise HTTPException(\n            status_code=status.HTTP_403_FORBIDDEN,\n            detail=\"Could not validate credentials\",\n        )\n    user = session.get(User, token_data.sub)\n    if not user:\n        raise HTTPException(status_code=404, detail=\"User not found\")\n    if not user.is_active:\n        raise HTTPException(status_code=400, detail=\"Inactive user\")\n    return user\n\n\nCurrentUser = Annotated[User, Depends(get_current_user)]\n\n\ndef get_current_active_superuser(current_user: CurrentUser) -> User:\n    if not current_user.is_superuser:\n        raise HTTPException(\n            status_code=403, detail=\"The user doesn't have enough privileges\"\n        )\n    return current_user\n","sourceCodeStart":36,"sourceCodeEnd":58,"githubUrl":"https://github.com/fastapi/full-stack-fastapi-template/blob/8063fe54f17d19f01720e055103af9cad3d8f55d/backend/app/api/deps.py#L36-L58","documentation":"Error \"The user doesn't have enough privileges\" thrown in fastapi/full-stack-fastapi-template.","triggerScenarios":"Thrown at backend/app/api/deps.py:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8063fe54f17d19f01720e055103af9cad3d8f55d","analyzedAt":"2026-08-26T06:49:32.317Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}