Skip to content

Commit 579295d

Browse files
authored
Remove unused permission classes (#10373)
1 parent 8bd1567 commit 579295d

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

readthedocs/api/v2/permissions.py

-24
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from rest_framework import permissions
44

55
from readthedocs.builds.models import Version
6-
from readthedocs.core.permissions import AdminPermission
76

87

98
class IsOwner(permissions.BasePermission):
@@ -15,29 +14,6 @@ def has_object_permission(self, request, view, obj):
1514
return request.user in obj.users.all()
1615

1716

18-
class CommentModeratorOrReadOnly(permissions.BasePermission):
19-
20-
def has_object_permission(self, request, view, obj):
21-
if request.method in permissions.SAFE_METHODS:
22-
return True # TODO: Similar logic to #1084
23-
return AdminPermission.is_admin(request.user, obj.node.project)
24-
25-
26-
class RelatedProjectIsOwner(permissions.BasePermission):
27-
28-
"""Custom permission to only allow owners of an object to edit it."""
29-
30-
def has_permission(self, request, view):
31-
return (request.method in permissions.SAFE_METHODS)
32-
33-
def has_object_permission(self, request, view, obj):
34-
# Write permissions are only allowed to the owner of the snippet
35-
return (
36-
request.method in permissions.SAFE_METHODS or
37-
(request.user in obj.project.users.all())
38-
)
39-
40-
4117
class APIRestrictedPermission(permissions.BasePermission):
4218

4319
"""

0 commit comments

Comments
 (0)