When accessing a taxonomy's tags in the REST API, the can_add_tag value is supposed to indicate if the user can add new tags to the taxonomy.
For system-defined or free text taxonomies, this value should always be false:
https://github.com/openedx/openedx-platform/blob/c0973707f398359a9a5ed87a72204a291ac1abe7/openedx/core/djangoapps/content_tagging/rules.py#L356-L369
However, because the logic for can_add_tag is only implemented as a permissions check, when a superuser uses the API, the can_add_tag value is always True, even for system-defined taxonomies and free text taxonomies, because the Django permissions code doesn't even evaluate the permissions predicate for superusers.
The result is that most devstack users will see the "+ add tag" button for these taxonomies, even though attempting to add a tag will result in an error:
(attempting to add a new tag then correctly displays an error:)
Related frontend issue: The error is reported three times, but none of those have the actual error reason shown. (TODO: open separate bug issue for this.)
When accessing a taxonomy's tags in the REST API, the
can_add_tagvalue is supposed to indicate if the user can add new tags to the taxonomy.For system-defined or free text taxonomies, this value should always be false:
https://github.com/openedx/openedx-platform/blob/c0973707f398359a9a5ed87a72204a291ac1abe7/openedx/core/djangoapps/content_tagging/rules.py#L356-L369
However, because the logic for
can_add_tagis only implemented as a permissions check, when a superuser uses the API, thecan_add_tagvalue is alwaysTrue, even for system-defined taxonomies and free text taxonomies, because the Django permissions code doesn't even evaluate the permissions predicate for superusers.The result is that most devstack users will see the "+ add tag" button for these taxonomies, even though attempting to add a tag will result in an error:
(attempting to add a new tag then correctly displays an error:)
Related frontend issue: The error is reported three times, but none of those have the actual error reason shown. (TODO: open separate bug issue for this.)