diff --git a/BeWo/Converter/UserPermission2BoolConverter.cs b/BeWo/Converter/UserPermission2BoolConverter.cs
index cf5c73043..eea34e3cd 100644
--- a/BeWo/Converter/UserPermission2BoolConverter.cs
+++ b/BeWo/Converter/UserPermission2BoolConverter.cs
@@ -14,6 +14,11 @@ namespace BeWo.Converter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
+#if DEBUG
+ if (BeWoApp.IsInDesignMode)
+ return true;
+#endif
+
try
{
if (value is UserRightType type)
@@ -36,6 +41,9 @@ namespace BeWo.Converter
if (setting == SettingsKeys.ShowGkvBzUrbelege)
return BeWoApp.Mandator.ShowGkvBzUrbelege;
+
+ if (setting == SettingsKeys.ShowAI)
+ return BeWoApp.AppSettings.ShowAI;
}
}
catch (Exception)
diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml b/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml
index f36c2b3c9..bc466f8e2 100644
--- a/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml
+++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml
@@ -53,25 +53,6 @@
Grid.Column="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
-
-
-
-
-
+
-
+ Header="{markup:Translate Promptbausteine}"
+ IsEnabled="{Binding Converter={StaticResource UserPermission2BoolConverter}, ConverterParameter={x:Static shared:UserRightType.AiModulePromptbausteineView}}">
-
+ Header="{markup:Translate Zeiterfassung}">
+
+
-
+
DataContract.CanEdit;
+ get => DataContract.CanEdit && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
set => DataContract.CanEdit = value;
}
diff --git a/BeWo/ViewModel/AiPromptbausteinPromptVM.cs b/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
index 5c0971b5b..96da4f4be 100644
--- a/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
+++ b/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
@@ -117,7 +117,7 @@ namespace BeWo.ViewModel
public bool CanEdit
{
- get => DataContract.CanEdit;
+ get => DataContract.CanEdit && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
set => DataContract.CanEdit = value;
}
diff --git a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs
index 31d118857..0d9026169 100644
--- a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs
+++ b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs
@@ -45,7 +45,7 @@ namespace BeWo.ViewModel.View.Administration
public DelegateCommand DeletePromptCommand { get; private set; }
public DelegateCommand ChangeFavoritenStatePromptCommand { get; private set; }
- public bool IsEditingMode { get; set; }
+ public bool CanEditPromptbausteine { get; set; }
public AiPromptbausteinFolderVM SelectedFolder
{
@@ -81,7 +81,7 @@ namespace BeWo.ViewModel.View.Administration
DeletePromptCommand = new DelegateCommand(OpenDeletePromptDialog, canOpenDeletePromptDialog, false);
ChangeFavoritenStatePromptCommand = new DelegateCommand(ChangeFavoritenStatePrompt, canChangeFavoritenStatePrompt, false);
- IsEditingMode = BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
+ CanEditPromptbausteine = BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
}
public override bool IsDirty
@@ -317,11 +317,11 @@ namespace BeWo.ViewModel.View.Administration
bool canOpenAddFolderDialog()
{
- return SelectedFolder?.CanAddFolder ?? true;
+ return CanEditPromptbausteine && (SelectedFolder?.CanAddFolder ?? true);
}
bool canOpenEditFolderDialog()
{
- return SelectedFolder?.CanEdit ?? false;
+ return CanEditPromptbausteine && (SelectedFolder?.CanEdit ?? false);
}
bool canCopyFolder()
{
@@ -335,7 +335,7 @@ namespace BeWo.ViewModel.View.Administration
}
bool canDeleteFolder()
{
- return SelectedFolder?.CanEdit ?? false;
+ return CanEditPromptbausteine && (SelectedFolder?.CanEdit ?? false);
}
void OpenAddPromptDialog()
@@ -444,7 +444,7 @@ namespace BeWo.ViewModel.View.Administration
bool canOpenAddPromptDialog()
{
- return SelectedFolder?.CanAddPrompt ?? false;
+ return CanEditPromptbausteine && (SelectedFolder?.CanAddPrompt ?? false);
}
bool canOpenEditPromptDialog()
{
@@ -452,7 +452,7 @@ namespace BeWo.ViewModel.View.Administration
}
bool canCopyPrompt()
{
- return SelectedPrompt is object;
+ return CanEditPromptbausteine && SelectedPrompt is object;
}
bool canPastePrompt()
{
@@ -460,7 +460,7 @@ namespace BeWo.ViewModel.View.Administration
}
bool canOpenDeletePromptDialog()
{
- return SelectedPrompt?.CanEdit ?? false;
+ return CanEditPromptbausteine && (SelectedPrompt?.CanEdit ?? false);
}
bool canChangeFavoritenStatePrompt()
diff --git a/Host/Web.Deploy.config b/Host/Web.Deploy.config
index 6dc8816ef..e12ca5903 100644
--- a/Host/Web.Deploy.config
+++ b/Host/Web.Deploy.config
@@ -390,7 +390,7 @@
-
+
diff --git a/Service/Core/ServiceHelper.cs b/Service/Core/ServiceHelper.cs
index 7bba45b55..6ef98a00b 100644
--- a/Service/Core/ServiceHelper.cs
+++ b/Service/Core/ServiceHelper.cs
@@ -100,6 +100,13 @@ namespace BeWo.Service.Core
var name = $"BeWo.Service.ServiceContracts.{pServiceInterface}";
var t = Type.GetType(name);
methodInfo = t?.GetMethod(pMethodName);
+
+ if(methodInfo is null)
+ {
+ name = $"BeWo.Service.ServiceContracts.Enhanced.{pServiceInterface}";
+ t = Type.GetType(name);
+ methodInfo = t?.GetMethod(pMethodName);
+ }
}
catch (Exception)
{
diff --git a/Service/ServiceContracts/Enhanced/IAiEnhancedService.cs b/Service/ServiceContracts/Enhanced/IAiEnhancedService.cs
index 9172cd3bd..c1a06dfbc 100644
--- a/Service/ServiceContracts/Enhanced/IAiEnhancedService.cs
+++ b/Service/ServiceContracts/Enhanced/IAiEnhancedService.cs
@@ -93,7 +93,7 @@ namespace BeWo.Service.ServiceContracts.Enhanced
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- [RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
+ [RequireWcfAuthorization(UserRightType.AiModulePromptbausteineView)]
IEnumerable UpdateAiPromptbausteinPrompt(IEnumerable prompts);
[FaultContract(typeof(BeWoFault))]
@@ -108,7 +108,7 @@ namespace BeWo.Service.ServiceContracts.Enhanced
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- [RequireWcfAuthorization(UserRightType.AiModulePromptbausteineView)]
+ [RequireWcfAuthorization(UserRightType.AiModuleServiceRecordDocu)]
AiFunctionDocResponse ExecuteAiFunctionServiceRecordDocumentation(AiFunctionDocRequest request);
}
}
\ No newline at end of file
diff --git a/Shared/Core/EnumTranslations.cs b/Shared/Core/EnumTranslations.cs
index 838b7bd81..c4a9fe9a5 100644
--- a/Shared/Core/EnumTranslations.cs
+++ b/Shared/Core/EnumTranslations.cs
@@ -777,7 +777,7 @@ namespace BS.Shared.Core
dict.Add(UserRightType.AiVoiceView, Translator.Translate($"KI-Spracheingabe & Transkription verwenden"));
- dict.Add(UserRightType.AiModuleChatView, Translator.Translate($"KI-Chat verwenden {action_keywords[0]}"));
+ dict.Add(UserRightType.AiModuleChatView, Translator.Translate($"KI-Chat (Allgemein) {action_keywords[0]}"));
//dict.Add(UserRightType.AiModuleChatAdd, Translator.Translate($"KI-Konversationen/Nachrichten {action_keywords[2]}"));
//dict.Add(UserRightType.AiModuleChatClone, Translator.Translate($"KI-Konversationen/Nachrichten {action_keywords[6]}"));
//dict.Add(UserRightType.AiModuleChatEdit, Translator.Translate($"KI-Konversationen/Nachrichten {action_keywords[3]}"));