resourcetype: Proper namespace handling

This commit is contained in:
Lennart
2025-01-04 14:58:33 +01:00
parent e7f51f040b
commit f406b7dbb2
11 changed files with 126 additions and 62 deletions

View File

@@ -64,7 +64,7 @@ pub trait Resource: Clone + 'static {
type Error: ResponseError + From<crate::Error>;
type PrincipalResource: Resource;
fn get_resourcetype(&self) -> &'static [&'static str];
fn get_resourcetype(&self) -> Resourcetype;
fn list_props() -> Vec<&'static str> {
[Self::PropName::VARIANTS, CommonPropertiesPropName::VARIANTS].concat()
@@ -78,7 +78,7 @@ pub trait Resource: Clone + 'static {
) -> Result<CommonPropertiesProp, Self::Error> {
Ok(match prop {
CommonPropertiesPropName::Resourcetype => {
CommonPropertiesProp::Resourcetype(Resourcetype(self.get_resourcetype()))
CommonPropertiesProp::Resourcetype(self.get_resourcetype())
}
CommonPropertiesPropName::CurrentUserPrincipal => {
CommonPropertiesProp::CurrentUserPrincipal(