Acceptance Criteria
- Make sure that the tagging system enforces all of the following permissions. Make changes to openedx_tagging and content_tagging as needed if some of these permissions aren't yet implemented correctly.
- Write tests to cover these if they are not yet tested. As much as possible the tests should use these same strings (see example below).
Who can view taxonomies:
includes seeing all tags and metadata. Does not necessarily allow the user to view ObjectTags using the taxonomy though.
- Users who are global staff can see all taxonomies (enabled and disabled)
- Users who are org-level admins (
OrgStaffRole) can see all taxonomies that are linked to their organization (enabled and disabled).
- Any user with access to Studio can see enabled taxonomies that are part of “all orgs”.
- Only global staff ("instance-level admins") can see non-system taxonomies that are not linked to any organization yet.
- Users who are not global staff ("instance-level admins") or org-level staff ("org-level admins") cannot see any disabled taxonomies.
- Users with other org-level roles (
OrgInstructorRole, OrgContentCreatorRole, or OrgLibraryUserRole) can see any of that org's enabled taxonomies.
- Users who are instructors for any course (via
CourseStaffRole or CourseInstructorRole) belonging to an org can see that org’s enabled taxonomies.
- Users who can view any v2 content libraries belonging to an org (
CAN_VIEW_THIS_CONTENT_LIBRARY) can view that org's enabled taxonomies.
This applies to the Taxonomies List Page as well as the Taxonomy Detail Page, though it must be implemented on the backend, not the frontend.
Who can export taxonomies
- Any user who can view a taxonomy can export it.
- Users who cannot view a taxonomy cannot export it.
Who can edit taxonomies:
- For MVP, only global staff ("instance-level superusers") can do the following in general. As well, org-level admins (
OrgStaffRole) can do the following for taxonomies that are linked to their org:
- import a taxonomy
- enable/disable a taxonomy
- edit a taxonomy's metadata
- edit a taxonomy's tags
- upload a new version of a taxonomy with different tags
- delete a taxonomy
- assign a taxonomy to organizations (global staff only)
- If an org-level admin imports or creates a taxonomy, it is automatically linked to their org.
- No users are allowed to edit system-defined taxonomies.
Who can view ObjectTags
- Any user who can view a content object (unit, component, or library component) in Studio can view that content object's tags.
- Any user who can not view a content object (unit, component, or library component) in Studio can not view that content object's tags.
Because of how the taxonomy permissions are defined, we don't really need to check if the user has permission to view the Taxonomy. Generally if the user can see the object, they'll be able to see the associated taxonomies. In the future we may extend these permissions to say that you can only view an ObjectTag if you can view the content object and you can view the taxonomy, but for now we only need to check the content object.
Who can edit ObjectTags
- Any user who can edit a content object (unit, component, or library component) in Studio can edit that content object's tags.
- Any user who can not edit a content object (unit, component, or library component) in Studio can not edit that content object's tags.
Developer Notes
- These should all be implemented as separate permissions ("can view this taxonomy", "can import a new taxonomy", "can enable/disable this taxonomy") and then use rules to define who has that permission. Do not directly check "roles" in the API - check permissions which are defined by rules which in turn check roles.
- The
can_export_taxonomy permission should be defined as equal to the can_view_taxonomy permission.
- As much as possible, permission tests in edx-platform should be clearly written using docstrings that are identical to the acceptance criteria above. e.g.
def test_global_staff_see_all(self):
"""
Users who are global staff can see all taxonomies (enabled and disabled)
"""
... # test the "list taxonomies" API and the "get taxonomy details" API
Acceptance Criteria
Who can view taxonomies:
includes seeing all tags and metadata. Does not necessarily allow the user to view
ObjectTags using the taxonomy though.OrgStaffRole) can see all taxonomies that are linked to their organization (enabled and disabled).OrgInstructorRole,OrgContentCreatorRole, orOrgLibraryUserRole) can see any of that org's enabled taxonomies.CourseStaffRoleorCourseInstructorRole) belonging to an org can see that org’s enabled taxonomies.CAN_VIEW_THIS_CONTENT_LIBRARY) can view that org's enabled taxonomies.This applies to the Taxonomies List Page as well as the Taxonomy Detail Page, though it must be implemented on the backend, not the frontend.
Who can export taxonomies
Who can edit taxonomies:
OrgStaffRole) can do the following for taxonomies that are linked to their org:Who can view ObjectTags
Because of how the taxonomy permissions are defined, we don't really need to check if the user has permission to view the Taxonomy. Generally if the user can see the object, they'll be able to see the associated taxonomies. In the future we may extend these permissions to say that you can only view an ObjectTag if you can view the content object and you can view the taxonomy, but for now we only need to check the content object.
Who can edit ObjectTags
Developer Notes
can_export_taxonomypermission should be defined as equal to thecan_view_taxonomypermission.