HKUDS/DeepTutor · error · HTTPException

Skill is not assigned to you

Error message

Skill is not assigned to you

What it means

Authorization refusal in GET /skills/{name}: the skill exists under admin scope and the caller is a non-admin without a grant for it, so access is denied with 403 — the skill exists but is not assignable to this user.

Solutions

  1. Ask an administrator to assign (grant) the skill to the user
  2. Use a user-scope skill of the same purpose if one exists
  3. Client: distinguish 403 (needs grant) from 404 (missing) in messaging
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at deeptutor/api/routers/skills.py:207 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/6d78b4457be9fd5a. Report an issue: GitHub.

Appendix: source

Thrown at deeptutor/api/routers/skills.py:207

@router.get("/{name}")
async def get_skill(name: str) -> dict[str, object]:
    service = get_skill_service()
    try:
        return service.get_detail(name).to_dict()
    except SkillNotFoundError:
        # User scope doesn't have it. Fall through to admin-assigned lookup
        # below, which returns 403 if the user has no grant for it.
        pass
    except InvalidSkillNameError as exc:
        raise HTTPException(status_code=400, detail=str(exc))

    user = get_current_user()
    if user.is_admin:
        # Admin scope already checked above; nothing else to look at.
        raise HTTPException(status_code=404, detail=f"Skill not found: {name}")
    if name not in assigned_skill_ids(user.id):
        raise HTTPException(status_code=403, detail="Skill is not assigned to you")
    detail = assigned_skill_detail(name)
    if detail is None:
        raise HTTPException(status_code=404, detail=f"Skill not found: {name}")
    return detail


@router.post("/create")
async def create_skill(payload: CreateSkillRequest) -> dict[str, object]:
    service = get_skill_service()
    try:
        info = service.create(
            name=payload.name,
            description=payload.description,
            content=payload.content,
            tags=list(payload.tags or []),
        )
        return info.to_dict()
    except SkillExistsError:

View on GitHub (pinned to 3e82f13042)