diff --git a/lib/utils/services-utils.js b/lib/utils/services-utils.js --- a/lib/utils/services-utils.js +++ b/lib/utils/services-utils.js @@ -2,8 +2,10 @@ import base64 from 'base-64'; +import { getConfig } from './config.js'; import { getMessageForException } from './errors.js'; import type { AuthMetadata } from '../shared/identity-client-context.js'; +import { isStaff, useIsCurrentUserStaff } from '../shared/staff-utils.js'; // If this is true, then the app is able to support multiple keyservers. This // requires the use of Tunnelbroker and the backup service to persist and sync @@ -29,11 +31,20 @@ // compaction and logs. // Keep in sync with native/cpp/CommonCpp/Tools/ServicesUtils.h function useFullBackupSupportEnabled(): boolean { - return false; + const isCurrentUserStaff = useIsCurrentUserStaff(); + if (getConfig().isStaffRelease) { + return true; + } + return isCurrentUserStaff; } -// eslint-disable-next-line no-unused-vars function fullBackupSupportEnabled(userID: ?string): boolean { - return false; + if (getConfig().isStaffRelease) { + return true; + } + if (!userID) { + return false; + } + return isStaff(userID); } function createHTTPAuthorizationHeader(authMetadata: AuthMetadata): string { diff --git a/native/cpp/CommonCpp/Tools/ServicesUtils.cpp b/native/cpp/CommonCpp/Tools/ServicesUtils.cpp --- a/native/cpp/CommonCpp/Tools/ServicesUtils.cpp +++ b/native/cpp/CommonCpp/Tools/ServicesUtils.cpp @@ -1,7 +1,12 @@ #include "ServicesUtils.h" +#include "StaffUtils.h" namespace comm { bool ServicesUtils::fullBackupSupport() { - return false; +#if DEBUG + return true; +#else + return StaffUtils::isStaffRelease(); +#endif } } // namespace comm