From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id B2B2E1FF183 for ; Wed, 22 Oct 2025 15:11:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C533818B0A; Wed, 22 Oct 2025 15:12:04 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Date: Wed, 22 Oct 2025 15:11:24 +0200 Message-ID: <20251022131126.358790-9-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251022131126.358790-1-s.sterz@proxmox.com> References: <20251022131126.358790-1-s.sterz@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761138682148 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.056 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH datacenter-manager v2 2/2] ui: add an AclContext via the AclContextProvider to the main app ui X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" by adding an `AclContextProvider` each component below can query the current `AclContext` and get re-rendered if it changes. Signed-off-by: Shannon Sterz --- ui/Cargo.toml | 1 + ui/src/main.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ui/Cargo.toml b/ui/Cargo.toml index 526380e..a901ff0 100644 --- a/ui/Cargo.toml +++ b/ui/Cargo.toml @@ -38,6 +38,7 @@ proxmox-human-byte = "1" proxmox-login = "1" proxmox-schema = "5" proxmox-rrd-api-types = "1" +proxmox-access-control = { version = "1.1", features = []} pbs-api-types = "1.0.3" pdm-api-types = { version = "0.9", path = "../lib/pdm-api-types" } diff --git a/ui/src/main.rs b/ui/src/main.rs index 715ecec..3465d24 100644 --- a/ui/src/main.rs +++ b/ui/src/main.rs @@ -17,8 +17,8 @@ use pbs_api_types::TaskListItem; use proxmox_login::Authentication; use proxmox_yew_comp::utils::init_task_descr_table_base; use proxmox_yew_comp::{ - authentication_from_cookie, http_get, register_auth_observer, AuthObserver, LoginPanel, - SubscriptionAlert, + authentication_from_cookie, http_get, register_auth_observer, AclContextProvider, AuthObserver, + LoginPanel, SubscriptionAlert, }; //use pbs::MainMenu; @@ -293,7 +293,9 @@ impl Component for DatacenterManagerApp { DesktopApp::new(html! { context={search_context}> {context}> - {body} + + {body} + > > }) @@ -342,5 +344,11 @@ fn main() { pwt::state::set_available_languages(proxmox_yew_comp::available_language_list()); + if let Err(e) = + proxmox_access_control::init::init_access_config(&pdm_api_types::AccessControlConfig) + { + log::error!("could not initialize access control config - {e:#}"); + } + yew::Renderer::::new().render(); } -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel