4242from __future__ import annotations
4343
4444import logging
45+ import warnings
4546from dataclasses import dataclass
4647from dataclasses import field as dataclass_field
4748from datetime import datetime
@@ -494,6 +495,12 @@ def get_library_team(library_key: LibraryLocatorV2) -> list[ContentLibraryPermis
494495 """
495496 Get the list of users/groups granted permission to use this library.
496497 """
498+ warnings .warn (
499+ "get_library_team is deprecated. See https://github.com/openedx/openedx-platform/issues/37409." ,
500+ DeprecationWarning ,
501+ stacklevel = 2 ,
502+ )
503+
497504 ref = ContentLibrary .objects .get_by_key (library_key )
498505 return [
499506 ContentLibraryPermissionEntry (user = entry .user , group = entry .group , access_level = entry .access_level )
@@ -506,6 +513,12 @@ def get_library_user_permissions(library_key: LibraryLocatorV2, user: UserType)
506513 Fetch the specified user's access information. Will return None if no
507514 permissions have been granted.
508515 """
516+ warnings .warn (
517+ "get_library_user_permissions is deprecated. See https://github.com/openedx/openedx-platform/issues/37409." ,
518+ DeprecationWarning ,
519+ stacklevel = 2 ,
520+ )
521+
509522 if isinstance (user , AnonymousUser ):
510523 return None # Mostly here for the type checker
511524 ref = ContentLibrary .objects .get_by_key (library_key )
@@ -525,6 +538,12 @@ def set_library_user_permissions(library_key: LibraryLocatorV2, user: UserType,
525538
526539 access_level should be one of the AccessLevel values defined above.
527540 """
541+ warnings .warn (
542+ "set_library_user_permissions is deprecated. See https://github.com/openedx/openedx-platform/issues/37409." ,
543+ DeprecationWarning ,
544+ stacklevel = 2 ,
545+ )
546+
528547 if isinstance (user , AnonymousUser ):
529548 raise TypeError ("Invalid user type" ) # Mostly here for the type checker
530549 ref = ContentLibrary .objects .get_by_key (library_key )
@@ -573,6 +592,12 @@ def set_library_group_permissions(library_key: LibraryLocatorV2, group, access_l
573592
574593 access_level should be one of the AccessLevel values defined above.
575594 """
595+ warnings .warn (
596+ "set_library_group_permissions is deprecated. See https://github.com/openedx/openedx-platform/issues/37409." ,
597+ DeprecationWarning ,
598+ stacklevel = 2 ,
599+ )
600+
576601 ref = ContentLibrary .objects .get_by_key (library_key )
577602
578603 if access_level is None :
0 commit comments