@@ -342,6 +342,12 @@ def post(self, request, lib_key_str):
342342 Add a user to this content library via email, with permissions specified in the
343343 request body.
344344 """
345+ warnings .warn (
346+ "LibraryTeamView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
347+ DeprecationWarning ,
348+ stacklevel = 2 ,
349+ )
350+
345351 key = LibraryLocatorV2 .from_string (lib_key_str )
346352 api .require_permission_for_library_key (key , request .user , permissions .CAN_EDIT_THIS_CONTENT_LIBRARY_TEAM )
347353 serializer = ContentLibraryAddPermissionByEmailSerializer (data = request .data )
@@ -369,6 +375,12 @@ def get(self, request, lib_key_str):
369375 Get the list of users and groups who have permissions to view and edit
370376 this library.
371377 """
378+ warnings .warn (
379+ "LibraryTeamView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
380+ DeprecationWarning ,
381+ stacklevel = 2 ,
382+ )
383+
372384 key = LibraryLocatorV2 .from_string (lib_key_str )
373385 api .require_permission_for_library_key (key , request .user , permissions .CAN_VIEW_THIS_CONTENT_LIBRARY_TEAM )
374386 team = api .get_library_team (key )
@@ -390,6 +402,12 @@ def put(self, request, lib_key_str, username):
390402 Add a user to this content library, with permissions specified in the
391403 request body.
392404 """
405+ warnings .warn (
406+ "LibraryTeamUserView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
407+ DeprecationWarning ,
408+ stacklevel = 2 ,
409+ )
410+
393411 key = LibraryLocatorV2 .from_string (lib_key_str )
394412 api .require_permission_for_library_key (key , request .user , permissions .CAN_EDIT_THIS_CONTENT_LIBRARY_TEAM )
395413 serializer = ContentLibraryPermissionLevelSerializer (data = request .data )
@@ -407,6 +425,12 @@ def get(self, request, lib_key_str, username):
407425 """
408426 Gets the current permissions settings for a particular user.
409427 """
428+ warnings .warn (
429+ "LibraryTeamUserView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
430+ DeprecationWarning ,
431+ stacklevel = 2 ,
432+ )
433+
410434 key = LibraryLocatorV2 .from_string (lib_key_str )
411435 api .require_permission_for_library_key (key , request .user , permissions .CAN_VIEW_THIS_CONTENT_LIBRARY_TEAM )
412436 user = get_object_or_404 (User , username = username )
@@ -421,6 +445,12 @@ def delete(self, request, lib_key_str, username):
421445 Remove the specified user's permission to access or edit this content
422446 library.
423447 """
448+ warnings .warn (
449+ "LibraryTeamUserView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
450+ DeprecationWarning ,
451+ stacklevel = 2 ,
452+ )
453+
424454 key = LibraryLocatorV2 .from_string (lib_key_str )
425455 api .require_permission_for_library_key (key , request .user , permissions .CAN_EDIT_THIS_CONTENT_LIBRARY_TEAM )
426456 user = get_object_or_404 (User , username = username )
@@ -445,6 +475,12 @@ def put(self, request, lib_key_str, group_name):
445475 Add a group to this content library, with permissions specified in the
446476 request body.
447477 """
478+ warnings .warn (
479+ "LibraryTeamGroupView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
480+ DeprecationWarning ,
481+ stacklevel = 2 ,
482+ )
483+
448484 key = LibraryLocatorV2 .from_string (lib_key_str )
449485 api .require_permission_for_library_key (key , request .user , permissions .CAN_EDIT_THIS_CONTENT_LIBRARY_TEAM )
450486 serializer = ContentLibraryPermissionLevelSerializer (data = request .data )
@@ -459,6 +495,12 @@ def delete(self, request, lib_key_str, username):
459495 Remove the specified user's permission to access or edit this content
460496 library.
461497 """
498+ warnings .warn (
499+ "LibraryTeamGroupView is deprecated. Use RoleUserAPIView from openedx-authz instead." ,
500+ DeprecationWarning ,
501+ stacklevel = 2 ,
502+ )
503+
462504 key = LibraryLocatorV2 .from_string (lib_key_str )
463505 api .require_permission_for_library_key (key , request .user , permissions .CAN_EDIT_THIS_CONTENT_LIBRARY_TEAM )
464506 group = get_object_or_404 (Group , username = username )
0 commit comments