diff --git a/client b/client index fc716f66..09d1f5b4 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit fc716f6673fba40b3d088285be923a9acdfff612 +Subproject commit 09d1f5b448a39f8c87560b7ddd4455c19f35a97d diff --git a/client-gui2 b/client-gui2 index e4f6e8a7..3731e19a 160000 --- a/client-gui2 +++ b/client-gui2 @@ -1 +1 @@ -Subproject commit e4f6e8a76f447d9421a8dc4f2cc87bf030bd5bd8 +Subproject commit 3731e19a49e5bd48d74056cdb2455d0ae0c65e1f diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index da27436c..66c0591e 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -140,6 +140,7 @@ message SetModuleConfigurationRequest { // Initializes an existing profile's bookkeeping currency. Empty leaves it unchanged. // Defaults scope and changes to an already configured currency are rejected. string accounting_currency = 3; + repeated ModuleDataAccessUpdate data_access_updates = 4; } message ModuleConfiguration { @@ -148,6 +149,31 @@ message ModuleConfiguration { repeated string selected_modules = 3; repeated string effective_modules = 5; string accounting_currency = 6; + repeated ModuleDataAccessRequest data_access_requests = 7; +} + +enum ModuleDataPermission { + MODULE_DATA_PERMISSION_UNSPECIFIED = 0; + MODULE_DATA_PERMISSION_ACCOUNTING_PERIOD_BALANCES = 1; +} + +enum ModuleDataAccessDecision { + MODULE_DATA_ACCESS_DECISION_UNSPECIFIED = 0; + MODULE_DATA_ACCESS_DECISION_ALLOW = 1; + MODULE_DATA_ACCESS_DECISION_REVOKE = 2; +} + +message ModuleDataAccessRequest { + string requesting_module = 1; + string providing_module = 2; + ModuleDataPermission permission = 3; + bool granted = 4; +} + +message ModuleDataAccessUpdate { + string requesting_module = 1; + ModuleDataPermission permission = 2; + ModuleDataAccessDecision decision = 3; } message CreateCustomExchangeRatesTableRequest { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 963f5a0c..b931c2a8 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.table_definition.rs b/common/src/proto/komp_ac.table_definition.rs index 3dbd3048..60f7a7f1 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -40,7 +40,7 @@ pub struct GetModuleConfigurationRequest { } /// Profile updates require an existing profile. Defaults affect future profiles only. #[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetModuleConfigurationRequest { #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, @@ -50,9 +50,11 @@ pub struct SetModuleConfigurationRequest { /// Defaults scope and changes to an already configured currency are rejected. #[prost(string, tag = "3")] pub accounting_currency: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "4")] + pub data_access_updates: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleConfiguration { #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, @@ -64,6 +66,30 @@ pub struct ModuleConfiguration { pub effective_modules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(string, tag = "6")] pub accounting_currency: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "7")] + pub data_access_requests: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ModuleDataAccessRequest { + #[prost(string, tag = "1")] + pub requesting_module: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub providing_module: ::prost::alloc::string::String, + #[prost(enumeration = "ModuleDataPermission", tag = "3")] + pub permission: i32, + #[prost(bool, tag = "4")] + pub granted: bool, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ModuleDataAccessUpdate { + #[prost(string, tag = "1")] + pub requesting_module: ::prost::alloc::string::String, + #[prost(enumeration = "ModuleDataPermission", tag = "2")] + pub permission: i32, + #[prost(enumeration = "ModuleDataAccessDecision", tag = "3")] + pub decision: i32, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -1121,6 +1147,67 @@ pub mod list_column_types_response { #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] +pub enum ModuleDataPermission { + Unspecified = 0, + AccountingPeriodBalances = 1, +} +impl ModuleDataPermission { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Unspecified => "MODULE_DATA_PERMISSION_UNSPECIFIED", + Self::AccountingPeriodBalances => { + "MODULE_DATA_PERMISSION_ACCOUNTING_PERIOD_BALANCES" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MODULE_DATA_PERMISSION_UNSPECIFIED" => Some(Self::Unspecified), + "MODULE_DATA_PERMISSION_ACCOUNTING_PERIOD_BALANCES" => { + Some(Self::AccountingPeriodBalances) + } + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ModuleDataAccessDecision { + Unspecified = 0, + Allow = 1, + Revoke = 2, +} +impl ModuleDataAccessDecision { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Unspecified => "MODULE_DATA_ACCESS_DECISION_UNSPECIFIED", + Self::Allow => "MODULE_DATA_ACCESS_DECISION_ALLOW", + Self::Revoke => "MODULE_DATA_ACCESS_DECISION_REVOKE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MODULE_DATA_ACCESS_DECISION_UNSPECIFIED" => Some(Self::Unspecified), + "MODULE_DATA_ACCESS_DECISION_ALLOW" => Some(Self::Allow), + "MODULE_DATA_ACCESS_DECISION_REVOKE" => Some(Self::Revoke), + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] pub enum InvoiceTemplateAccountingRole { Unspecified = 0, InvoiceTemplateAccountingName = 1, diff --git a/server b/server index 7a2f9372..5e28c7fe 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 7a2f937242efbba365025a99cac7508b0a247280 +Subproject commit 5e28c7fe06a4b5fb58e3c01ddf6cc5f6374f4c3b