π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Decouple flag for public link and admin url
Neeraj Gupta69bdbe462f5f
diff --git a/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart b/mobile/apps/photos/lib/ui/sharing/album_participants_page.dartindex c6df48038d..5a39ab1b32 100644--- a/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart+++ b/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart@@ -77,12 +77,14 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {final currentUserID = Configuration.instance.getUserID()!;final role = _collection.getRole(currentUserID);final bool adminRoleEnabled = flagService.enableAdminRole;+ final bool surfacePublicLinkEnabled = flagService.surfacePublicLink;final bool isOwner = role == CollectionParticipantRole.owner;final bool isAdmin = role == CollectionParticipantRole.admin;final bool canManageParticipants = isOwner || (adminRoleEnabled && isAdmin);final bool hasActivePublicLink = _collection.hasLink &&!(_collection.publicURLs.firstOrNull?.isExpired ?? true);- final bool shouldShowPublicLink = !isOwner && hasActivePublicLink;+ final bool shouldShowPublicLink =+ !isOwner && hasActivePublicLink && surfacePublicLinkEnabled;final colorScheme = getEnteColorScheme(context);final int participants = 1 + _collection.getSharees().length;final User owner = _collection.owner;diff --git a/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart b/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dartindex d71246e133..4e98ff7402 100644--- a/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart+++ b/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart@@ -44,6 +44,7 @@ class FlagService {bool get internalUser => flags.internalUser || kDebugMode;bool get enableAdminRole => internalUser;+ bool get surfacePublicLink => internalUser;bool get betaUser => flags.betaUser;diff --git a/web/apps/photos/src/components/Collections/CollectionShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare.tsxindex 087354b2dc..cb3113b3a2 100644--- a/web/apps/photos/src/components/Collections/CollectionShare.tsx+++ b/web/apps/photos/src/components/Collections/CollectionShare.tsx@@ -115,7 +115,8 @@ export const CollectionShare: React.FC<CollectionShareProps> = ({onRemotePull,}) => {const settings = useSettingsSnapshot();- const { isInternalUser, isAdminRoleEnabled } = settings;+ const { isInternalUser, isAdminRoleEnabled, isSurfacePublicLinkEnabled } =+ settings;const { onGenericError } = useBaseContext();const { showLoadingBar, hideLoadingBar } = usePhotosAppContext();@@ -157,7 +158,8 @@ export const CollectionShare: React.FC<CollectionShareProps> = ({const showEmailSection = !isSharedIncoming || canManageParticipants;const hasPublicLink = collection.publicURLs.length > 0;const showPublicShare =- isOwner || (isSharedIncoming && hasPublicLink && isAdminRoleEnabled);+ isOwner ||+ (isSharedIncoming && hasPublicLink && isSurfacePublicLinkEnabled);return (<SidebarDrawer anchor="right" {...{ open, onClose }}>diff --git a/web/packages/new/photos/services/settings.ts b/web/packages/new/photos/services/settings.tsindex 02f3c0c309..045027a708 100644--- a/web/packages/new/photos/services/settings.ts+++ b/web/packages/new/photos/services/settings.ts@@ -51,6 +51,10 @@ export interface Settings {* `true` if admin role management features are enabled.*/isAdminRoleEnabled: boolean;+ /**+ * `true` if public link surfaces should be shown to non-owners.+ */+ isSurfacePublicLinkEnabled: boolean;/*** `true` if maps are enabled.@@ -111,6 +115,7 @@ export interface Settings {const createDefaultSettings = (): Settings => ({isInternalUser: false,isAdminRoleEnabled: false,+ isSurfacePublicLinkEnabled: false,mapEnabled: false,cfUploadProxyDisabled: false,castURL: "https://cast.ente.io",@@ -204,6 +209,8 @@ const syncSettingsSnapshotWithLocalStorage = () => {settings.isInternalUser = flags?.internalUser || false;settings.isAdminRoleEnabled =(flags?.internalUser ?? false) || isDevBuild;+ settings.isSurfacePublicLinkEnabled =+ (flags?.internalUser ?? false) || isDevBuild;settings.mapEnabled = flags?.mapEnabled || false;settings.cfUploadProxyDisabled = savedCFProxyDisabled();if (flags?.castUrl) settings.castURL = flags.castUrl;