Skip to content

Commit

Permalink
pro version can use search
Browse files Browse the repository at this point in the history
  • Loading branch information
JoinTyang committed Aug 25, 2024
1 parent b6b5997 commit 1c27ae5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion seahub/api2/endpoints/public_repos_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from seahub.api2.authentication import TokenAuthentication
from seahub.api2.throttling import UserRateThrottle
from seahub.api2.permissions import IsProVersion
from seahub.api2.utils import api_error
from seahub.utils.repo import is_valid_repo_id_format
from seahub.utils import HAS_FILE_SEARCH, HAS_FILE_SEASEARCH
Expand All @@ -25,7 +26,7 @@ class PublishedRepoSearchView(APIView):
""" Search public repos
"""
authentication_classes = (TokenAuthentication, SessionAuthentication)
permission_classes = (IsAuthenticatedOrReadOnly,)
permission_classes = (IsAuthenticatedOrReadOnly, IsProVersion)
throttle_classes = (UserRateThrottle, )

def get(self, request):
Expand Down
3 changes: 2 additions & 1 deletion seahub/api2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from .utils import get_diff_details, to_python_boolean, \
api_error, get_file_size, prepare_starred_files, is_web_request, \
get_groups, api_group_check, get_timestamp, json_response
from seahub.api2.permissions import IsProVersion
from seahub.wopi.utils import get_wopi_dict
from seahub.api2.base import APIView
from seahub.api2.models import TokenV2, DESKTOP_PLATFORMS
Expand Down Expand Up @@ -443,7 +444,7 @@ class Search(APIView):
""" Search all the repos
"""
authentication_classes = (TokenAuthentication, SessionAuthentication)
permission_classes = (IsAuthenticated,)
permission_classes = (IsAuthenticated, IsProVersion)
throttle_classes = (UserRateThrottle, )

def get(self, request, format=None):
Expand Down
2 changes: 2 additions & 0 deletions seahub/seadoc/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

from seahub.views import check_folder_permission
from seahub.api2.authentication import TokenAuthentication, SdocJWTTokenAuthentication
from seahub.api2.permissions import IsProVersion
from seahub.api2.utils import api_error, user_to_dict, to_python_boolean, get_user_common_info
from seahub.api2.throttling import UserRateThrottle
from seahub.seadoc.utils import is_valid_seadoc_access_token, get_seadoc_upload_link, \
Expand Down Expand Up @@ -2900,6 +2901,7 @@ def post(self, request, file_uuid):
class SeadocSearchFilenameView(APIView):

authentication_classes = (SdocJWTTokenAuthentication, TokenAuthentication, SessionAuthentication)
permission_classes = (IsProVersion, )
throttle_classes = (UserRateThrottle,)

def get(self, request, file_uuid):
Expand Down

0 comments on commit 1c27ae5

Please sign in to comment.