chore: remove dependency on rest_condition (#28663)
rest-condition has not been updated for a while, and with DRF 3.9 it is no longer needed since the ability to combine Permission classes using boolean operators is now provided by DRF directly.
This commit is contained in:
@@ -10,7 +10,6 @@ from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthenticat
|
||||
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
|
||||
from opaque_keys import InvalidKeyError
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from rest_condition import C
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
@@ -156,16 +155,17 @@ class CertificatesListView(APIView):
|
||||
BearerAuthenticationAllowInactiveUser,
|
||||
SessionAuthenticationAllowInactiveUser,
|
||||
)
|
||||
# pylint: disable=unsupported-binary-operation
|
||||
permission_classes = (
|
||||
C(IsAuthenticated) & (
|
||||
C(permissions.NotJwtRestrictedApplication) |
|
||||
IsAuthenticated & (
|
||||
permissions.NotJwtRestrictedApplication |
|
||||
(
|
||||
C(permissions.JwtRestrictedApplication) &
|
||||
permissions.JwtRestrictedApplication &
|
||||
permissions.JwtHasScope &
|
||||
permissions.JwtHasUserFilterForRequestedUser
|
||||
)
|
||||
),
|
||||
(C(permissions.IsStaff) | IsOwnerOrPublicCertificates), # pylint: disable=unsupported-binary-operation
|
||||
permissions.IsStaff | IsOwnerOrPublicCertificates,
|
||||
)
|
||||
|
||||
required_scopes = ['certificates:read']
|
||||
|
||||
Reference in New Issue
Block a user