mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +00:00
only pro version has Institution feature (#6133)
This commit is contained in:
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { siteRoot, gettext, appAvatarURL, enableSSOToThirdpartWebsite } from '../../utils/constants';
|
||||
import { siteRoot, isPro, gettext, appAvatarURL, enableSSOToThirdpartWebsite } from '../../utils/constants';
|
||||
import toaster from '../toast';
|
||||
|
||||
const {
|
||||
@@ -131,7 +131,7 @@ class Account extends Component {
|
||||
url: `${siteRoot}org/info/`,
|
||||
text: gettext('Organization Admin')
|
||||
};
|
||||
} else if (isInstAdmin) {
|
||||
} else if (isPro && isInstAdmin) {
|
||||
data = {
|
||||
url: `${siteRoot}inst/useradmin/`,
|
||||
text: gettext('Institution Admin')
|
||||
|
@@ -139,7 +139,7 @@ class SidePanel extends React.Component {
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
{multiInstitution && otherPermission &&
|
||||
{isPro && multiInstitution && otherPermission &&
|
||||
<li className="nav-item">
|
||||
<Link
|
||||
className={`nav-link ellipsis ${this.getActiveClass('institutions')}`}
|
||||
|
@@ -7,10 +7,9 @@ from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from seaserv import seafile_api, ccnet_api
|
||||
|
||||
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.base.templatetags.seahub_tags import email2nickname, email2contact_email
|
||||
@@ -54,7 +53,7 @@ def get_institution_user_info(user_obj, institution, is_check_admin=True):
|
||||
class AdminInstitutionUsers(APIView):
|
||||
|
||||
authentication_classes = (TokenAuthentication, SessionAuthentication)
|
||||
permission_classes = (IsAdminUser, )
|
||||
permission_classes = (IsAdminUser, IsProVersion)
|
||||
throttle_classes = (UserRateThrottle, )
|
||||
|
||||
def get(self, request, institution_id):
|
||||
@@ -185,7 +184,7 @@ class AdminInstitutionUsers(APIView):
|
||||
class AdminInstitutionUser(APIView):
|
||||
|
||||
authentication_classes = (TokenAuthentication, SessionAuthentication)
|
||||
permission_classes = (IsAdminUser, )
|
||||
permission_classes = (IsAdminUser, IsProVersion)
|
||||
throttle_classes = (UserRateThrottle, )
|
||||
|
||||
def put(self, request, institution_id, email):
|
||||
|
@@ -6,16 +6,15 @@ from rest_framework.permissions import IsAdminUser
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from seaserv import seafile_api, ccnet_api
|
||||
|
||||
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.profile.models import Profile
|
||||
from seahub.utils.file_size import get_file_size_unit
|
||||
from seahub.utils.timeutils import datetime_to_isoformat_timestr
|
||||
from seahub.institutions.models import Institution, InstitutionQuota, InstitutionAdmin
|
||||
from seahub.institutions.models import Institution, InstitutionQuota
|
||||
from seahub.institutions.utils import get_institution_space_usage
|
||||
from seahub.signals import institution_deleted
|
||||
|
||||
@@ -25,7 +24,7 @@ logger = logging.getLogger(__name__)
|
||||
class AdminInstitutions(APIView):
|
||||
|
||||
authentication_classes = (TokenAuthentication, SessionAuthentication)
|
||||
permission_classes = (IsAdminUser, )
|
||||
permission_classes = (IsAdminUser, IsProVersion)
|
||||
throttle_classes = (UserRateThrottle, )
|
||||
|
||||
def get(self, request):
|
||||
@@ -91,7 +90,7 @@ class AdminInstitutions(APIView):
|
||||
class AdminInstitution(APIView):
|
||||
|
||||
authentication_classes = (TokenAuthentication, SessionAuthentication)
|
||||
permission_classes = (IsAdminUser, )
|
||||
permission_classes = (IsAdminUser, IsProVersion)
|
||||
throttle_classes = (UserRateThrottle, )
|
||||
|
||||
def get(self, request, institution_id):
|
||||
|
Reference in New Issue
Block a user