Skip to content

New content-library response serializes can_edit_library without request context #39169

Open

Description

@lifeofgurpreet

Checked 2026-09-30: master source at ca039029e4918f02903b1c7d62adf8b3ad74f75b and release/verawood source at 18ce9a9c2b20c745b0ee94f615c13855acd9624b. Both carry this code path. This is a source diagnostic; no upstream full integration suite or production mutation ran.

LibraryRootView.post grants the creator admin permissions and then constructs the response serializer without request context. The serializer permission method returns false when context has no request. The library detail GET does supply request context.

Reproduction: create a v2 library as an author allowed to create libraries; inspect can_edit_library in the POST response, then fetch the detail as the same author. The create response follows the no-request/false branch despite the just-granted permissions; the context-aware detail can report the actual permission.

Expected: the successful create response reports the creator's actual edit permission, consistently with the detail response. Pass the request through get_serializer or explicit serializer context. Test creator, reader and denied caller without weakening authorization.

This report's current-source claim is the missing context and deterministic serializer false branch. No fresh end-to-end library creation ran for this filing. Duplicate checks: current issue/PR searches for LibraryRootView and can_edit_library context returned no matching report.

Activity

  1. Nagini-dotcom commented on Oct 31, 2026

    @Nagini-dotcom

    Hi Maintainers!

    I am a beginner contributor interested in working on this issue as part of my team's open-source contribution.
    I understand that the issue involves the "can_edit_library" field returning an incorrect permission value because the request context is missing from the content-library creation response.
    I would like to investigate the relevant view and serializer, implement the appropriate fix, and add regression tests to verify the permission behaviour.
    Could you please confirm whether this issue is available to work on and whether this approach is appropriate?
    Any guidance would be greatly appreciated.

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions