"Shared Drive" can be disabled in configuration (#335)

This commit is contained in:
Anton Shepilov
2024-01-19 21:30:38 +03:00
committed by GitHub
parent 4769a23480
commit e887d820e5
7 changed files with 34 additions and 20 deletions
@@ -133,6 +133,7 @@
"server": "PLUGINS_SERVER"
},
"drive": {
"featureSharedDrive": "ENABLE_FEATURE_SHARED_DRIVE",
"rootAdmins": "DRIVE_ROOT_ADMINS",
"defaultLanguage": "DRIVE_DEFAULT_LANGUAGE",
"featureSearchUsers": "ENABLE_FEATURE_SEARCH_USERS"
+1
View File
@@ -135,6 +135,7 @@
"debug": true
},
"drive": {
"featureSharedDrive": true,
"featureSearchUsers": true
},
"applications": {
@@ -58,6 +58,9 @@ export function formatCompany(
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]: JSON.parse(
config.get("drive.featureSearchUsers") || "true",
),
[CompanyFeaturesEnum.COMPANY_SHARED_DRIVE]: JSON.parse(
config.get("drive.featureSharedDrive") || "true",
),
},
{
...(res.plan?.features || {}),
@@ -93,6 +93,7 @@ export const companyObjectSchema = {
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]: { type: "boolean" },
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]: { type: "boolean" },
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]: { type: "boolean" },
[CompanyFeaturesEnum.COMPANY_SHARED_DRIVE]: { type: "boolean" },
guests: { type: "number" }, // to rename or delete
members: { type: "number" }, // to rename or delete
storage: { type: "number" }, // to rename or delete
@@ -84,6 +84,7 @@ export enum CompanyFeaturesEnum {
CHAT_UNLIMITED_STORAGE = "chat:unlimited_storage",
COMPANY_INVITE_MEMBER = "company:invite_member",
COMPANY_SEARCH_USERS = "company:search_users",
COMPANY_SHARED_DRIVE = "company:shared_drive",
}
export type CompanyFeaturesObject = {
@@ -94,6 +95,7 @@ export type CompanyFeaturesObject = {
[CompanyFeaturesEnum.CHAT_UNLIMITED_STORAGE]?: boolean;
[CompanyFeaturesEnum.COMPANY_INVITE_MEMBER]?: boolean;
[CompanyFeaturesEnum.COMPANY_SEARCH_USERS]?: boolean;
[CompanyFeaturesEnum.COMPANY_SHARED_DRIVE]?: boolean;
};
export type CompanyLimitsObject = {