-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
openedx/openedx-learning
#63Description
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 fieldssystem_definedor_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 therules.pyadded 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 inopenedx_tagging/core/tagging/rules.py, but inside Studio, they'll use the overwritten rules defined inopenedx/features/content_tagging/rules.py
Refer to the Users section of the MVP for a detailed permissions breakdown.
- add new taxonomy with metadata:
- 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_taggingcontext (no need to test the views themselves here; those tests will live with their code ^), and bump the version ofopenedx-learningif 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
- Generic tagging: Allow custom Taxonomy, ObjectTag subclasses to customize tagging behavior openedx-learning#62
Anything that would be useful for the general tagging app should go here. - Content tagging: feat: adds Content Tagging edx-platform#32661
Only code that is content- or org-specific should build on this change.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done