User API lists collaborators' channel ids the requester can't view

未关闭
#6,420 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
1/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
api, backend, security

调研方向

Read contentcuration/contentcuration/viewsets/user.py, especially UserViewSet and annotate_queryset, and review the strategy in issue #6398. Add regression tests for a co-editor whose other channel is hidden from the requester and for the requester's own record; done means collaborator channel IDs are filtered while own channel lists and sharing views keep working. The issue says it is not open for contribution.

由索引模型根据 Issue 内容生成。

描述

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

GET /api/user/ returns, for every user the requester can see, the ids of all channels that user edits or views. A user can see their co-editors and co-viewers, so they get the ids of their collaborators' other channels, including ones they have no access to.

Complexity: Low
Target branch: hotfixes

Context
  • UserViewSet returns editable_channels and view_only_channels, which annotate_queryset aggregates over all of each user's channels.
  • Reproduced: a co-editor's GET /api/user/ response listed the other editor's full editable_channels and view_only_channels, including channels the requester couldn't open.
The Change
  • For any user other than the requester, editable_channels and view_only_channels should only list channels the requester can view, following the strategy in #6398. The frontend's sharing views read these fields, and should keep working.
Acceptance Criteria
General
  • For another user's record, editable_channels and view_only_channels contain only channels the requester can view.
  • The requester's own record still lists all their channels.
  • The channel sharing views show the same collaborators as before.
Testing
  • Regression tests cover a co-editor with a channel the requester can't view, and the requester's own record.

AI usage

I chose which audit findings belong in #6398 and set the access pattern. Claude Code found and reproduced this gap and drafted this issue.

主要语言
Python
星标
212
派生
321
平均合并
1 天 7 小时
30 天内合并 PR
14

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

learningequality/studio 的其他 Issue

查看 learningequality/studio 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。