feat: implement tag object rest api in cms - #33181
Conversation
|
Thanks for the pull request, @rpenido! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
…ect_rest_api_in_cms
| openedx-filters # Open edX Filters from Hooks Extension Framework (OEP-50) | ||
| openedx-learning # Open edX Learning core (experimental) | ||
| # openedx-learning # Open edX Learning core (experimental) | ||
| openedx-learning @ git+https://github.com/openedx/openedx-learning@main # Remove this once openedx-learning is tagged |
There was a problem hiding this comment.
@bradenmacdonald could you please create a tag to deploy the new version of openedx-learning?
There was a problem hiding this comment.
Sure, done. We'll need to merge this PR soon because v0.1.6 has a breaking change:
File "/openedx/edx-platform/openedx/features/content_tagging/rules.py", line 99, in <module>
def can_change_object_tag(user: User, object_tag: oel_tagging.ObjectTag = None) -> bool:
AttributeError: module 'openedx_tagging.core.tagging.rules' has no attribute 'ObjectTag'
There was a problem hiding this comment.
I'm pinning the version to avoid unwanted updates while openedx-learning is in development/unstable.
Does that make sense? bb18095
There was a problem hiding this comment.
Yes that makes sense.
| rules.set_perm("oel_tagging.view_object_tag", rules.always_allow) | ||
|
|
||
| # Users can tag objects using tags from any taxonomy that they have permission to view | ||
| rules.set_perm("oel_tagging.change_objecttag_taxonomy", can_change_object_tag_taxonomy) |
There was a problem hiding this comment.
@rpenido Could you update the comments here to give the information that this perms are used on openedx_tagging. A developer who doesn't know this can get lost here.
| ("oel_tagging.add_object_tag", "tax_both_course1"), | ||
| ("oel_tagging.add_object_tag", "tax_both_course2"), | ||
| ("oel_tagging.add_object_tag", "tax_both_xblock1"), | ||
| ("oel_tagging.add_object_tag", "tax_both_xblock2"), |
There was a problem hiding this comment.
@rpenido Maybe to avoid this boilerplate, you can have an static list of all tag_attr (are the same for the three perms) and only leave the three perms on the ddt
There was a problem hiding this comment.
Done 7eb4139
Let me know if I got it right!
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
bradenmacdonald
left a comment
There was a problem hiding this comment.
I would prefer to see a test or two that actually uses the REST API to change the tags of a component, where it works if the user has edit permission on the course and returns 403 if the user doesn't have edit permission on that course.
Also, we need to update the dependency to use the new tag v0.1.6 that I just published. Otherwise, this looks good! I can merge tomorrow.
2763102 to
03d51ab
Compare
03d51ab to
52c529b
Compare
|
Hello @bradenmacdonald! How are you doing?
Done 64107d1
Done 52c529b |
1822ed9 to
bb18095
Compare
|
Hi @bradenmacdonald! Is there something I can do to help this get merged? Thank you! |
|
@rpenido I'll merge it today. |
|
@rpenido 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
This PR implements the tagging REST API for creating/updating object tags in Courses and XBlocks.
Supporting Information
Testing instructions
Private ref: FAL-3499