From 4fcbe3253d7b97f2c6de26c44d96c96bccc5644e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=A1=BA=E5=BC=BA?= Date: Tue, 15 Jan 2019 10:45:53 +0800 Subject: [PATCH] add share limit (#2827) --- frontend/src/components/dialog/share-to-group.js | 4 ++-- frontend/src/components/dialog/share-to-user.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/dialog/share-to-group.js b/frontend/src/components/dialog/share-to-group.js index a922ec915d..a7d0e34118 100644 --- a/frontend/src/components/dialog/share-to-group.js +++ b/frontend/src/components/dialog/share-to-group.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { Button } from 'reactstrap'; import Select from 'react-select'; import makeAnimated from 'react-select/lib/animated'; -import { gettext } from '../../utils/constants'; +import { gettext, isPro } from '../../utils/constants'; import { seafileAPI } from '../../utils/seafile-api.js'; import SharePermissionEditor from '../select-editor/share-permission-editor'; @@ -101,7 +101,7 @@ class ShareToGroup extends React.Component { }; this.options = []; this.permissions = ['rw', 'r', 'cloud-edit', 'preview']; - if (this.props.isGroupOwnedRepo) { + if (this.props.isGroupOwnedRepo || !isPro) { this.permissions = ['rw', 'r']; } } diff --git a/frontend/src/components/dialog/share-to-user.js b/frontend/src/components/dialog/share-to-user.js index bf960ccdab..5d07ee0cef 100644 --- a/frontend/src/components/dialog/share-to-user.js +++ b/frontend/src/components/dialog/share-to-user.js @@ -1,7 +1,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import AsyncSelect from 'react-select/lib/Async'; -import { gettext } from '../../utils/constants'; +import { gettext, isPro } from '../../utils/constants'; import { Button } from 'reactstrap'; import { seafileAPI } from '../../utils/seafile-api.js'; import SharePermissionEditor from '../select-editor/share-permission-editor'; @@ -101,7 +101,7 @@ class ShareToUser extends React.Component { }; this.options = []; this.permissions = ['rw', 'r', 'admin', 'cloud-edit', 'preview']; - if (this.props.isGroupOwnedRepo) { + if (this.props.isGroupOwnedRepo || !isPro) { this.permissions = ['rw', 'r']; } }