From e3c9bcbe76d2055aa9bd5e81defc3bb71e2d7f6e Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:50:24 +0100 Subject: [PATCH] fix: rebase --- backends/src/client/permit.rs | 51 ----------------------------------- 1 file changed, 51 deletions(-) diff --git a/backends/src/client/permit.rs b/backends/src/client/permit.rs index 68a7f5639..cd006db8d 100644 --- a/backends/src/client/permit.rs +++ b/backends/src/client/permit.rs @@ -494,57 +494,6 @@ impl Client { Ok(()) } - - async fn get_user_projects(&self, user_id: &str) -> Result, Error> { - let perms = get_user_permissions_user_permissions_post( - &self.pdp, - UserPermissionsQuery { - user: Box::new(User { - key: user_id.to_owned(), - ..Default::default() - }), - resource_types: Some(vec!["Project".to_owned()]), - tenants: Some(vec!["default".to_owned()]), - ..Default::default() - }, - None, - None, - ) - .await?; - - Ok(perms.into_values().collect()) - } - - async fn is_allowed( - &self, - user_id: &str, - project_id: &str, - action: &str, - ) -> Result { - // NOTE: This API function was modified in upstream to use AuthorizationQuery - let res = is_allowed_allowed_post( - &self.pdp, - AuthorizationQuery { - user: Box::new(User { - key: user_id.to_owned(), - ..Default::default() - }), - action: action.to_owned(), - resource: Box::new(Resource { - r#type: "Project".to_string(), - key: Some(project_id.to_owned()), - tenant: Some("default".to_owned()), - ..Default::default() - }), - ..Default::default() - }, - None, - None, - ) - .await?; - - Ok(res.allow.unwrap_or_default()) - } } /// Higher level management methods. Use with care.