Eigenes Recht zum Klonen
This commit is contained in:
@@ -55,7 +55,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
ReloadModelsCommand = new DelegateCommand(ReloadModels);
|
||||
|
||||
OpenSettingCommand = new DelegateCommand(OpenSetting, () => BeWoApp.AppSettings.ModuleAiSettingsEnabled && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleViewSetting));
|
||||
OpenCloneCommand = new DelegateCommand(OpenClone, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatAdd) && SelectedVM is object);
|
||||
OpenCloneCommand = new DelegateCommand(OpenClone, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatClone) && SelectedVM is object);
|
||||
CloneCommand = new DelegateCommand(Clone);
|
||||
|
||||
AskDeleteCommand = new DelegateCommand(AskDelete, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatDelete) && SelectedVM is object);
|
||||
|
||||
@@ -291,7 +291,7 @@ namespace BeWo.ViewModel
|
||||
return false;
|
||||
}
|
||||
private static bool IsAiModuleRight(UserRightType right) =>
|
||||
ContainsRight(right, UserRightType.AiModuleView, UserRightType.AiModuleView2, UserRightType.AiModuleChatAdd, UserRightType.AiModuleChatDelete, UserRightType.AiModuleChatEdit, UserRightType.AiModuleViewSetting);
|
||||
ContainsRight(right, UserRightType.AiModuleView, UserRightType.AiModuleView2, UserRightType.AiModuleChatAdd, UserRightType.AiModuleChatDelete, UserRightType.AiModuleChatEdit, UserRightType.AiModuleViewSetting, UserRightType.AiModuleChatClone);
|
||||
|
||||
private static bool ContainsRight(UserRightType right, params UserRightType[] rightTypes)
|
||||
{
|
||||
|
||||
@@ -205,6 +205,7 @@ namespace BeWo.Data.Security
|
||||
|| r == UserRightType.AiModuleChatAdd
|
||||
|| r == UserRightType.AiModuleChatDelete
|
||||
|| r == UserRightType.AiModuleChatEdit
|
||||
|| r == UserRightType.AiModuleChatClone
|
||||
|| r == UserRightType.AiModuleViewSetting;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BeWo.Service.ServiceContracts
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequirePermission(UserRightType.AiModuleChatAdd)]
|
||||
[RequirePermission(UserRightType.AiModuleChatClone)]
|
||||
AiConversationDC CloneAiConversation(long conversation_oid, long? message_oid);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
|
||||
@@ -632,6 +632,7 @@ namespace BS.Shared
|
||||
AiModuleChatDelete = 201003,
|
||||
AiModuleView2 = 201004,
|
||||
AiModuleViewSetting = 201005,
|
||||
AiModuleChatClone = 201006,
|
||||
}
|
||||
|
||||
public enum PersonType
|
||||
|
||||
@@ -639,7 +639,7 @@ namespace BS.Shared.Core
|
||||
{
|
||||
var dict = new Dictionary<UserRightType, String>();
|
||||
|
||||
var action_keywords = new string[] { "ansehen", "verwalten", "anlegen", "bearbeiten", "löschen", "senden" };
|
||||
var action_keywords = new string[] { "ansehen", "verwalten", "anlegen", "bearbeiten", "löschen", "senden", "klonen" };
|
||||
|
||||
dict.Add(UserRightType.CreateAll, Translator.Translate("Alles anlegen"));
|
||||
|
||||
@@ -718,6 +718,7 @@ namespace BS.Shared.Core
|
||||
dict.Add(UserRightType.AiModuleView, Translator.Translate($"Module AI {action_keywords[0]}"));
|
||||
dict.Add(UserRightType.AiModuleView2, Translator.Translate($"Module AI 2 {action_keywords[0]}"));
|
||||
dict.Add(UserRightType.AiModuleChatAdd, Translator.Translate($"Module AI-> Konversationen/Nachrichten {action_keywords[2]}"));
|
||||
dict.Add(UserRightType.AiModuleChatClone, Translator.Translate($"Module AI-> Konversationen/Nachrichten {action_keywords[6]}"));
|
||||
dict.Add(UserRightType.AiModuleChatEdit, Translator.Translate($"Module AI-> Konversationen/Nachrichten {action_keywords[3]}"));
|
||||
dict.Add(UserRightType.AiModuleChatDelete, Translator.Translate($"Module AI-> Konversationen/Nachrichten {action_keywords[4]}"));
|
||||
dict.Add(UserRightType.AiModuleViewSetting, Translator.Translate($"Module AI-> Einstellungen {action_keywords[0]}"));
|
||||
|
||||
Reference in New Issue
Block a user