Web:Files:Settings: disable common and admin settings for pesonal
This commit is contained in:
parent
af23406c4a
commit
3ad8b6c4c8
@ -19,6 +19,7 @@ const SectionBodyContent = ({
|
||||
history,
|
||||
setExpandSettingsTree,
|
||||
setSelectedNode,
|
||||
isPersonal,
|
||||
t,
|
||||
}) => {
|
||||
const commonSettings = {
|
||||
@ -41,11 +42,13 @@ const SectionBodyContent = ({
|
||||
|
||||
const elements = [];
|
||||
|
||||
if (isAdmin) {
|
||||
if (isAdmin && !isPersonal) {
|
||||
elements.push(adminSettings);
|
||||
}
|
||||
|
||||
if (!isPersonal) {
|
||||
elements.push(commonSettings);
|
||||
}
|
||||
|
||||
if (enableThirdParty) {
|
||||
elements.push(connectedCloud);
|
||||
@ -78,15 +81,16 @@ const SectionBodyContent = ({
|
||||
case "admin":
|
||||
return 0;
|
||||
case "connected-clouds":
|
||||
return isAdmin ? 2 : 1;
|
||||
return isAdmin ? (isPersonal ? 0 : 2) : 1;
|
||||
default:
|
||||
return isAdmin ? 1 : 0;
|
||||
}
|
||||
}, [setting]);
|
||||
}, [setting, isAdmin, isPersonal]);
|
||||
|
||||
return !settingsIsLoaded ? null : (!enableThirdParty &&
|
||||
setting === "thirdParty") ||
|
||||
(!isAdmin && setting === "admin") ? (
|
||||
setting === "connected-clouds") ||
|
||||
(!isAdmin && setting === "admin") ||
|
||||
(isPersonal && setting !== "connected-clouds") ? (
|
||||
<Error403 />
|
||||
) : isErrorSettings ? (
|
||||
<Error520 />
|
||||
@ -108,9 +112,11 @@ export default inject(({ auth, treeFoldersStore, settingsStore }) => {
|
||||
|
||||
setExpandSettingsTree,
|
||||
} = settingsStore;
|
||||
|
||||
const { setSelectedNode } = treeFoldersStore;
|
||||
return {
|
||||
isAdmin: auth.isAdmin,
|
||||
isPersonal: auth.settingsStore.personal,
|
||||
enableThirdParty,
|
||||
settingsIsLoaded,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user