mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-26 00:24:55 +01:00
Implement categories support
This commit is contained in:
parent
17005c0536
commit
f524079914
@ -43,6 +43,7 @@
|
|||||||
},
|
},
|
||||||
Another =
|
Another =
|
||||||
{ wiki = "test_another"
|
{ wiki = "test_another"
|
||||||
|
, category = "test"
|
||||||
, disclose = "lab.test.read"
|
, disclose = "lab.test.read"
|
||||||
, manage = "lab.test.admin"
|
, manage = "lab.test.admin"
|
||||||
, name = "Another"
|
, name = "Another"
|
||||||
|
@ -194,6 +194,9 @@ async fn fill_machine_builder(
|
|||||||
if let Some(ref wiki) = machine.desc.wiki {
|
if let Some(ref wiki) = machine.desc.wiki {
|
||||||
builder.set_wiki(wiki);
|
builder.set_wiki(wiki);
|
||||||
}
|
}
|
||||||
|
if let Some(ref category) = machine.desc.category {
|
||||||
|
builder.set_category(category);
|
||||||
|
}
|
||||||
builder.set_urn(&format!("urn:fabaccess:resource:{}", id.as_ref()));
|
builder.set_urn(&format!("urn:fabaccess:resource:{}", id.as_ref()));
|
||||||
|
|
||||||
let machineapi = Machine::new(user.clone(), perms, machine.clone());
|
let machineapi = Machine::new(user.clone(), perms, machine.clone());
|
||||||
|
@ -97,6 +97,7 @@ impl Default for Config {
|
|||||||
name: "Testmachine".to_string(),
|
name: "Testmachine".to_string(),
|
||||||
description: Some("A test machine".to_string()),
|
description: Some("A test machine".to_string()),
|
||||||
wiki: None,
|
wiki: None,
|
||||||
|
category: None,
|
||||||
privs: PrivilegesBuf {
|
privs: PrivilegesBuf {
|
||||||
disclose: PermissionBuf::from_string("lab.test.read".to_string()),
|
disclose: PermissionBuf::from_string("lab.test.read".to_string()),
|
||||||
read: PermissionBuf::from_string("lab.test.read".to_string()),
|
read: PermissionBuf::from_string("lab.test.read".to_string()),
|
||||||
|
@ -368,6 +368,9 @@ pub struct MachineDescription {
|
|||||||
#[serde(default, skip_serializing_if = "Option::is_none", deserialize_with = "deser_option")]
|
#[serde(default, skip_serializing_if = "Option::is_none", deserialize_with = "deser_option")]
|
||||||
pub wiki: Option<String>,
|
pub wiki: Option<String>,
|
||||||
|
|
||||||
|
#[serde(default, skip_serializing_if = "Option::is_none", deserialize_with = "deser_option")]
|
||||||
|
pub category: Option<String>,
|
||||||
|
|
||||||
/// The permission required
|
/// The permission required
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub privs: access::PrivilegesBuf,
|
pub privs: access::PrivilegesBuf,
|
||||||
|
Loading…
Reference in New Issue
Block a user