def METHOD_NAME(self, request, repo_id):
    """ Check if repo password is correct.
    Permission checking:
    1. User can access current repo.
    """
    # argument check
    password = request.data.get('password', None)
    if not password:
        error_msg = 'password invalid.'
        return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    # resource check
    repo = seafile_api.get_repo(repo_id)
    if not repo:
        error_msg = 'Library %s not found.' % repo_id
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    if not repo.encrypted:
        error_msg = 'Library %s is not encrypted.' % repo_id
        return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    # permission check
    if not check_folder_permission(request, repo_id, '/'):
        error_msg = 'Permission denied.'
        return api_error(status.HTTP_403_FORBIDDEN, error_msg)
    # check the password is correct
    try:
        seafile_api.set_passwd(repo_id, request.user.username, password)
    except SearpcError as e:
        if e.msg == 'Bad arguments':
            error_msg = 'Bad arguments'
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
        elif e.msg == 'Incorrect password':
            error_msg = _('Wrong password')
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
        elif e.msg == 'Internal server error':
            error_msg = _('Internal Server Error')
            return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
        else:
            error_msg = _('Decrypt library error')
            return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    if ENABLE_RESET_ENCRYPTED_REPO_PASSWORD:
        add_encrypted_repo_secret_key_to_database(repo_id, password)
    return Response({'success': True})