From 4d819a1041b0adfce3757df50929764afa10e27b Mon Sep 17 00:00:00 2001 From: mdecimus Date: Mon, 21 Jul 2025 12:48:19 +0200 Subject: [PATCH] Exclude SEL licensed code from AGPL licensed code (closes #783 closes #768) --- crates/directory/src/core/principal.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/directory/src/core/principal.rs b/crates/directory/src/core/principal.rs index 7e9d6f67..63989c3c 100644 --- a/crates/directory/src/core/principal.rs +++ b/crates/directory/src/core/principal.rs @@ -358,11 +358,17 @@ impl PrincipalSet { // SPDX-SnippetBegin // SPDX-FileCopyrightText: 2020 Stalwart Labs LLC // SPDX-License-Identifier: LicenseRef-SEL + #[cfg(feature = "enterprise")] pub fn tenant(&self) -> Option { self.get_int(PrincipalField::Tenant).map(|v| v as u32) } // SPDX-SnippetEnd + #[cfg(not(feature = "enterprise"))] + pub fn tenant(&self) -> Option { + None + } + pub fn description(&self) -> Option<&str> { self.get_str(PrincipalField::Description) } @@ -1421,10 +1427,16 @@ impl Permission { ) } + #[cfg(not(feature = "enterprise"))] + pub const fn is_tenant_admin_permission(&self) -> bool { + false + } + // SPDX-SnippetBegin // SPDX-FileCopyrightText: 2020 Stalwart Labs LLC // SPDX-License-Identifier: LicenseRef-SEL + #[cfg(feature = "enterprise")] pub const fn is_tenant_admin_permission(&self) -> bool { matches!( self,