Skip to content

Commit

Permalink
fix (#7228)
Browse files Browse the repository at this point in the history
* fix

* fix-format

---------

Co-authored-by: 孙永强 <[email protected]>
Co-authored-by: r350178982 <[email protected]>
  • Loading branch information
3 people authored Dec 27, 2024
1 parent 9d63b3c commit 76695e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions frontend/src/pages/sys-admin/groups/groups-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link } from '@gatsbyjs/reach-router';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { Utils } from '../../../utils/utils';
import { siteRoot, gettext } from '../../../utils/constants';
import { siteRoot, gettext, isPro } from '../../../utils/constants';
import Loading from '../../../components/loading';
import EmptyTip from '../../../components/empty-tip';
import Paginator from '../../../components/paginator';
Expand Down Expand Up @@ -224,6 +224,13 @@ class Item extends Component {
`${siteRoot}sys/groups/${item.id}/libraries/` :
`${siteRoot}sys/departments/${item.id}/`;

let operations = [];
if (isPro) {
operations = ['Delete', 'Transfer', 'Change'];
} else {
operations = ['Delete', 'Transfer'];
}

return (
<Fragment>
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
Expand All @@ -240,7 +247,7 @@ class Item extends Component {
<td>
{(isOpIconShown && item.owner != 'system admin') &&
<OpMenu
operations={['Delete', 'Transfer', 'Change']}
operations={operations}
translateOperations={this.translateOperations}
onMenuItemClick={this.onMenuItemClick}
onFreezedItem={this.props.onFreezedItem}
Expand Down
3 changes: 2 additions & 1 deletion seahub/api2/endpoints/admin/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from seahub.api2.utils import api_error
from seahub.api2.throttling import UserRateThrottle
from seahub.api2.authentication import TokenAuthentication
from seahub.api2.permissions import IsProVersion
from seahub.share.models import ExtraGroupsSharePermission
from seahub.utils.ccnet_db import CcnetDB

Expand Down Expand Up @@ -404,7 +405,7 @@ def get(self, request):
class AdminGroupToDeptView(APIView):
"""group to department"""
authentication_classes = (TokenAuthentication, SessionAuthentication)
permission_classes = (IsAdminUser,)
permission_classes = (IsAdminUser, IsProVersion)
throttle_classes = (UserRateThrottle,)

def post(self, request, group_id):
Expand Down

0 comments on commit 76695e5

Please sign in to comment.