Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tagging] Taxonomy view/management APIs #73

Closed
pomegranited opened this issue Jul 18, 2023 · 0 comments · Fixed by openedx/openedx-learning#63
Closed

[Tagging] Taxonomy view/management APIs #73

pomegranited opened this issue Jul 18, 2023 · 0 comments · Fixed by openedx/openedx-learning#63

Comments

@pomegranited
Copy link

pomegranited commented Jul 18, 2023

Story

"As a Taxonomy Administrator, I want to be able to create, edit, and delete taxonomies so that I can manage the tagging fields and tags available for content authors."

Full description

ref MVP discovery

Implement a Django Rest Framework (DRF) REST API that allows listing and retrieving, and editing taxonomies available to the logged-in user and their metadata (taxonomy name, etc). This REST API will be used by the taxonomy management frontend, to be developed later.

  • views: support
    • add new taxonomy with metadata: name, description, enabled, required, allow_multiple, allow_free_text
      Should not be able to change the fields system_defined or _taxonomy_class
      • view a taxonomy: return metadata
      • edit metadata for an existing taxonomy
      • delete a taxonomy
    • permissions: these REST APIs should only allow editing taxonomy metadata or deleting taxonomies if the user is allowed to.
      Implement DRF-compatible permissions classes using the rules.py added by [Tagging] Implement Taxonomy Data Architecture models + APIs #63, e.g.
      python request.user.has_perm("oel_tagging.add_taxonomy") # Can the current user add a new taxonomy? request.user.has_perm("oel_tagging.change_taxonomy", taxonomy) # Can the current user edit this taxonomy?
      These rules should use the most appropriate context available, i.e inside openedx-learning, they'll use the rules defined in openedx_tagging/core/tagging/rules.py, but inside Studio, they'll use the overwritten rules defined in openedx/features/content_tagging/rules.py
      Refer to the Users section of the MVP for a detailed permissions breakdown.
  • code: the REST APIs should be thin; most of the code you need already exists in the python APIs (if you need more, err towards adding to those APIs, keeping the views minimal)
  • structure: add new files to openedx-learning under openedx_tagging/core/tagging/rest_api/v1/: views.py, permissions.py, serializers.py, urls.py
    See other REST APIs in edx-platform for examples, e.g. course_api
  • endpoints: these endpoints will be exposed as URLs in Studio, since oel_tagging is a ensure they're accessible in under <studio root>/api/v1/content_tagging/
  • documentation: these REST API views should be documented like the ones in the platform, see e.g. e.g. course_api views

Note: this API doesn’t include editing taxonomy tags, just its metadata. In this phase, taxonomy tags can only be edited through the
import/export APIs.

Completion criteria

  • PR against openedx-learning to add the REST API views, supporting code, and tests, specifically verifying permissions are enforced.
  • PR against edx-platform to add permissions tests for these views in the content_tagging context (no need to test the views themselves here; those tests will live with their code ^), and bump the version of openedx-learning if required.
  • Automated testing must cover all code added here.

Documentation updates & improvements criteria

  • If you find anything amiss in the docs/ or README when working on this change, feel free to update them too.

Relevant repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants