feat: adds Content Tagging (#32661)
* refactor: moves is_content_creator from cms.djangoapps.contentstore.helpers to common.djangoapps.student.auth * feat: adds content tagging app Adds models and APIs to support tagging content objects (e.g. XBlocks, content libraries) by content authors. Content tags can be thought of as "name:value" fields, though underneath they are a bit more complicated. * adds dependency on openedx-learning<=0.1.0 * adds tagging app to LMS and CMS * adds content tagging models, api, rules, admin, and tests. * content taxonomies and tags can be maintained per organization by content creators for that organization.
This commit is contained in:
@@ -20,8 +20,6 @@ from xmodule.exceptions import NotFoundError
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from common.djangoapps.student import auth
|
||||
from common.djangoapps.student.roles import CourseCreatorRole, OrgContentCreatorRole
|
||||
import openedx.core.djangoapps.content_staging.api as content_staging_api
|
||||
|
||||
from .utils import reverse_course_url, reverse_library_url, reverse_usage_url
|
||||
@@ -377,15 +375,3 @@ def is_item_in_course_tree(item):
|
||||
ancestor = ancestor.get_parent()
|
||||
|
||||
return ancestor is not None
|
||||
|
||||
|
||||
def is_content_creator(user, org):
|
||||
"""
|
||||
Check if the user has the role to create content.
|
||||
|
||||
This function checks if the User has role to create content
|
||||
or if the org is supplied, it checks for Org level course content
|
||||
creator.
|
||||
"""
|
||||
return (auth.user_has_role(user, CourseCreatorRole()) or
|
||||
auth.user_has_role(user, OrgContentCreatorRole(org=org)))
|
||||
|
||||
@@ -45,7 +45,8 @@ from common.djangoapps.student.auth import (
|
||||
has_course_author_access,
|
||||
has_studio_read_access,
|
||||
has_studio_write_access,
|
||||
has_studio_advanced_settings_access
|
||||
has_studio_advanced_settings_access,
|
||||
is_content_creator,
|
||||
)
|
||||
from common.djangoapps.student.roles import (
|
||||
CourseInstructorRole,
|
||||
@@ -118,7 +119,6 @@ from ..utils import (
|
||||
update_course_discussions_settings,
|
||||
)
|
||||
from .component import ADVANCED_COMPONENT_TYPES
|
||||
from ..helpers import is_content_creator
|
||||
from cms.djangoapps.contentstore.xblock_storage_handlers.view_handlers import (
|
||||
create_xblock_info,
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ from common.djangoapps.student.auth import (
|
||||
STUDIO_VIEW_USERS,
|
||||
get_user_permissions,
|
||||
has_studio_read_access,
|
||||
has_studio_write_access
|
||||
has_studio_write_access,
|
||||
)
|
||||
from common.djangoapps.student.roles import (
|
||||
CourseInstructorRole,
|
||||
|
||||
Reference in New Issue
Block a user