mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-12-22 19:53:49 +01:00
Implement categories support
This commit is contained in:
parent
17005c0536
commit
f524079914
@ -43,6 +43,7 @@
|
||||
},
|
||||
Another =
|
||||
{ wiki = "test_another"
|
||||
, category = "test"
|
||||
, disclose = "lab.test.read"
|
||||
, manage = "lab.test.admin"
|
||||
, name = "Another"
|
||||
|
@ -194,6 +194,9 @@ async fn fill_machine_builder(
|
||||
if let Some(ref wiki) = machine.desc.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()));
|
||||
|
||||
let machineapi = Machine::new(user.clone(), perms, machine.clone());
|
||||
|
@ -97,6 +97,7 @@ impl Default for Config {
|
||||
name: "Testmachine".to_string(),
|
||||
description: Some("A test machine".to_string()),
|
||||
wiki: None,
|
||||
category: None,
|
||||
privs: PrivilegesBuf {
|
||||
disclose: 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")]
|
||||
pub wiki: Option<String>,
|
||||
|
||||
#[serde(default, skip_serializing_if = "Option::is_none", deserialize_with = "deser_option")]
|
||||
pub category: Option<String>,
|
||||
|
||||
/// The permission required
|
||||
#[serde(flatten)]
|
||||
pub privs: access::PrivilegesBuf,
|
||||
|
Loading…
Reference in New Issue
Block a user