mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
repo admin can enable metadata (#6569)
This commit is contained in:
@@ -322,7 +322,7 @@ class DirColumnNav extends React.Component {
|
||||
isDisplayFiles={this.state.isDisplayFiles}
|
||||
/>
|
||||
</TreeSection>
|
||||
<DirViews repoID={repoID} currentPath={currentPath} userPerm={userPerm} />
|
||||
<DirViews repoID={repoID} currentPath={currentPath} userPerm={userPerm} currentRepoInfo={currentRepoInfo} />
|
||||
<DirOthers
|
||||
repoID={repoID}
|
||||
userPerm={userPerm}
|
||||
|
@@ -4,7 +4,7 @@ import { gettext } from '../../utils/constants';
|
||||
import TreeSection from '../tree-section';
|
||||
import { MetadataStatusManagementDialog, MetadataTreeView, useMetadata } from '../../metadata';
|
||||
|
||||
const DirViews = ({ userPerm, repoID, currentPath }) => {
|
||||
const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
|
||||
const enableMetadataManagement = useMemo(() => {
|
||||
return window.app.pageOptions.enableMetadataManagement;
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
@@ -13,8 +13,7 @@ const DirViews = ({ userPerm, repoID, currentPath }) => {
|
||||
const [showMetadataStatusManagementDialog, setShowMetadataStatusManagementDialog] = useState(false);
|
||||
const { enableMetadata, updateEnableMetadata, navigation } = useMetadata();
|
||||
const moreOperations = useMemo(() => {
|
||||
if (!enableMetadataManagement) return [];
|
||||
if (userPerm !== 'rw' && userPerm !== 'admin') return [];
|
||||
if (!enableMetadataManagement || !currentRepoInfo.is_admin) return [];
|
||||
return [
|
||||
{ key: 'extended-properties', value: gettext('Extended properties') }
|
||||
];
|
||||
|
Reference in New Issue
Block a user