chore: deprecate content library authorization rest apis and models
This commit is contained in:
committed by
Feanil Patel
parent
b367336d60
commit
efb3a57d79
@@ -36,8 +36,9 @@ from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import logging
|
||||
from typing import ClassVar
|
||||
import uuid
|
||||
import warnings
|
||||
from typing import ClassVar
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Group
|
||||
@@ -65,6 +66,15 @@ from .apps import ContentLibrariesConfig
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
warnings.warn(
|
||||
(
|
||||
"ContentLibraryPermission model and related content library authorization "
|
||||
"APIs are deprecated. See https://github.com/openedx/openedx-platform/issues/37409."
|
||||
),
|
||||
DeprecationWarning
|
||||
)
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
@@ -187,6 +197,8 @@ class ContentLibraryPermission(models.Model):
|
||||
"""
|
||||
Row recording permissions for a content library
|
||||
|
||||
Deprecated https://github.com/openedx/openedx-platform/issues/37409.
|
||||
|
||||
.. no_pii:
|
||||
"""
|
||||
library = models.ForeignKey(ContentLibrary, on_delete=models.CASCADE, related_name="permission_grants")
|
||||
|
||||
@@ -65,6 +65,7 @@ the api module instead.
|
||||
import itertools
|
||||
import json
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
import edx_api_doc_tools as apidocs
|
||||
from django.conf import settings
|
||||
@@ -136,6 +137,15 @@ User = get_user_model()
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
warnings.warn(
|
||||
(
|
||||
"Content library team authorization REST APIs are deprecated. "
|
||||
"See https://github.com/openedx/openedx-platform/issues/37409."
|
||||
),
|
||||
DeprecationWarning
|
||||
)
|
||||
|
||||
|
||||
class LibraryApiPaginationDocs:
|
||||
"""
|
||||
API docs for query params related to paginating ContentLibraryMetadata objects.
|
||||
@@ -323,6 +333,8 @@ class LibraryTeamView(APIView):
|
||||
|
||||
Note also the 'allow_public_' settings which can be edited by PATCHing the
|
||||
library itself (LibraryDetailsView.patch).
|
||||
|
||||
Deprecated https://github.com/openedx/openedx-platform/issues/37409
|
||||
"""
|
||||
@convert_exceptions
|
||||
def post(self, request, lib_key_str):
|
||||
@@ -369,6 +381,8 @@ class LibraryTeamUserView(APIView):
|
||||
"""
|
||||
View to add/remove/edit an individual user's permissions for a content
|
||||
library.
|
||||
|
||||
Deprecated https://github.com/openedx/openedx-platform/issues/37409
|
||||
"""
|
||||
@convert_exceptions
|
||||
def put(self, request, lib_key_str, username):
|
||||
@@ -422,6 +436,8 @@ class LibraryTeamUserView(APIView):
|
||||
class LibraryTeamGroupView(APIView):
|
||||
"""
|
||||
View to add/remove/edit a group's permissions for a content library.
|
||||
|
||||
Deprecated https://github.com/openedx/openedx-platform/issues/37409
|
||||
"""
|
||||
@convert_exceptions
|
||||
def put(self, request, lib_key_str, group_name):
|
||||
|
||||
Reference in New Issue
Block a user