diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-19 01:46:41 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-19 01:46:41 +0200 |
| commit | 466340a97f8a158570f84fc12238101ca9c124ec (patch) | |
| tree | 5400eb9aeeac9571079b4d80fb4eeac5abf103fa /Software | |
| parent | cd5006f765c65482033d671095f34453acfc416b (diff) | |
| download | Tango-466340a97f8a158570f84fc12238101ca9c124ec.tar.gz Tango-466340a97f8a158570f84fc12238101ca9c124ec.zip | |
Data store improvements.
Added line number to logs viewer.
Added DataStore Create Write Global permission.
Added FSE application path to "Path" environment variable for dsUtil.
Completed dsUtil.
Diffstat (limited to 'Software')
16 files changed, 255 insertions, 96 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex b80bbc9b0..58fbcac47 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex b06dad7d5..981698cbd 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip index dc6557505..86a02fb0f 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip @@ -63,6 +63,8 @@ <ROW Component="AI_ExePath" ComponentId="{C34670D7-E692-46D3-8154-6A8F253B99E5}" Directory_="APPDIR" Attributes="4" KeyPath="AI_ExePath"/> <ROW Component="APPDIR" ComponentId="{5B123F96-C6BB-44F7-8539-1EF68B1B7EB8}" Directory_="APPDIR" Attributes="0"/> <ROW Component="ColorMine.dll" ComponentId="{2A12535E-52C6-4B4F-9428-6CFB916E8EEF}" Directory_="APPDIR" Attributes="0" KeyPath="ColorMine.dll"/> + <ROW Component="CommandLine.dll" ComponentId="{24319897-21B4-4195-AA8F-D40FBD667C56}" Directory_="APPDIR" Attributes="0" KeyPath="CommandLine.dll"/> + <ROW Component="ConsoleTables.dll" ComponentId="{D1C789E8-946A-4A52-B58E-75B8E859647B}" Directory_="APPDIR" Attributes="0" KeyPath="ConsoleTables.dll"/> <ROW Component="ControlzEx.dll" ComponentId="{9F73B283-098E-4615-8608-2BAFB9347E87}" Directory_="APPDIR" Attributes="0" KeyPath="ControlzEx.dll"/> <ROW Component="D17D1EE3B5447079AEF0A1CF58498F1" ComponentId="{8E526DB3-B68B-4DBF-B262-BF34E040418E}" Directory_="APPDIR" Attributes="4" KeyPath="D17D1EE3B5447079AEF0A1CF58498F1" Options="2"/> <ROW Component="DeviceId.dll" ComponentId="{95686F7C-16B2-46F2-8AF2-E2B3A85ED7AD}" Directory_="APPDIR" Attributes="0" KeyPath="DeviceId.dll"/> @@ -303,8 +305,10 @@ <ROW Component="Tango.Console.dll" ComponentId="{EA15B4D4-5171-4747-8F7D-0D21CF8CAFD3}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Console.dll"/> <ROW Component="Tango.Core.dll" ComponentId="{FEA537DB-7B1F-4B88-940A-9911A4D29057}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Core.dll"/> <ROW Component="Tango.DAL.Remote.dll" ComponentId="{62700DCA-5334-45BB-9B3F-1E60D8E1CB51}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DAL.Remote.dll"/> - <ROW Component="Tango.DataStore.Remote.dll" ComponentId="{DC3934E7-E3F0-4995-A415-117E35345F66}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DataStore.Remote.dll"/> - <ROW Component="Tango.DataStore.dll" ComponentId="{935AC8A1-F425-4763-B91B-FBD559AA35F0}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DataStore.dll"/> + <ROW Component="Tango.DataStore.EF.dll" ComponentId="{5215BDBC-6406-4097-A6A3-399A3C1FF929}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DataStore.EF.dll"/> + <ROW Component="Tango.DataStore.Editing.dll" ComponentId="{3004AEDD-C2BF-4ADE-9153-64F6E651F3AE}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DataStore.Editing.dll"/> + <ROW Component="Tango.DataStore.Remote.dll" ComponentId="{0D39C3C3-A272-4A82-B757-83E6B0D6BB4D}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DataStore.Remote.dll"/> + <ROW Component="Tango.DataStore.dll" ComponentId="{DA61514D-C2D7-4909-80EA-0CCF2B1DBB97}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DataStore.dll"/> <ROW Component="Tango.Documents.dll" ComponentId="{FB9E5160-6481-4879-AFC6-89C3D7E21ED6}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Documents.dll"/> <ROW Component="Tango.DragAndDrop.dll" ComponentId="{E660863F-2225-48FE-B966-E7375A48FBF1}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DragAndDrop.dll"/> <ROW Component="Tango.Emulations.dll" ComponentId="{87B4BB2B-DA02-47A4-B738-F0D388ED5B03}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Emulations.dll"/> @@ -314,6 +318,7 @@ <ROW Component="Tango.FSE.Firmware.dll" ComponentId="{39C1ACAC-0329-4779-BBD7-59921B537853}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.Firmware.dll"/> <ROW Component="Tango.FSE.Insights.dll" ComponentId="{E41D03EC-502F-4FF3-8B6B-A89D02C248B2}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.Insights.dll"/> <ROW Component="Tango.FSE.LogViewer.UI.exe" ComponentId="{C233F6D7-7B11-4EB0-99FA-601176F47BA5}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.LogViewer.UI.exe"/> + <ROW Component="Tango.FSE.MachineConfiguration.dll" ComponentId="{28010BC7-AC6F-4F33-9883-A7A2919A8F36}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.MachineConfiguration.dll"/> <ROW Component="Tango.FSE.PPCConsole.dll" ComponentId="{439D6114-54E3-4FCB-A01E-148ECB966139}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.PPCConsole.dll"/> <ROW Component="Tango.FSE.Procedures.dll" ComponentId="{FDA82EB3-2A9B-4A57-AB30-970433B497BE}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.Procedures.dll"/> <ROW Component="Tango.FSE.UI.exe" ComponentId="{79C3B470-6540-474A-90AE-F0E7C34AEA43}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.FSE.UI.exe"/> @@ -361,6 +366,7 @@ <ROW Component="__3" ComponentId="{D63D43F2-053E-4811-81BC-F11D89795E42}" Directory_="APPDIR" Attributes="4" KeyPath="__3"/> <ROW Component="__4" ComponentId="{D0E846F2-7BDB-4985-A828-405634871827}" Directory_="APPDIR" Attributes="4" KeyPath="__4"/> <ROW Component="__5" ComponentId="{95AD0530-ED57-4222-992A-782C6CFBD980}" Directory_="APPDIR" Attributes="4" KeyPath="__5"/> + <ROW Component="dsUtil.exe" ComponentId="{976E1F19-4FE1-46DF-824B-0DFFDAC3959C}" Directory_="APPDIR" Attributes="0" KeyPath="dsUtil.exe"/> <ROW Component="ffmpeg.exe" ComponentId="{D6862E01-A64B-40FD-847E-A35B561EFD1D}" Directory_="APPDIR" Attributes="0" KeyPath="ffmpeg.exe"/> <ROW Component="log" ComponentId="{A7C3DA27-9188-401A-9CD1-218B0504E461}" Directory_="APPDIR" Attributes="4" KeyPath="log_2"/> <ROW Component="mscoree.dll" ComponentId="{B7304190-8E59-45C3-B972-4611DEB9DE60}" Directory_="APPDIR" Attributes="0" KeyPath="mscoree.dll"/> @@ -372,10 +378,10 @@ <ROW Component="protobufnet.dll" ComponentId="{ED37672F-F343-44FB-8FBD-F9003BD20D52}" Directory_="APPDIR" Attributes="0" KeyPath="protobufnet.dll"/> <ROW Component="shell" ComponentId="{A08B0CB0-9A35-4E7B-B7A3-F0039D92CBE4}" Directory_="APPDIR" Attributes="4" KeyPath="shell"/> <ROW Component="shell_1" ComponentId="{082186C6-1C9B-401A-85E8-3F1DA42DD4C6}" Directory_="APPDIR" Attributes="4" KeyPath="shell_1"/> - <ROW Component="turbojpeg.dll" ComponentId="{E709DEA3-C3B6-4289-A24C-EE7B3C725E3F}" Directory_="win7x64_Dir" Attributes="256" KeyPath="turbojpeg.dll"/> - <ROW Component="turbojpeg.dll.meta" ComponentId="{F3C4814A-27B2-468B-9239-96BCD4B7CB2C}" Directory_="win7x64_Dir" Attributes="0" KeyPath="turbojpeg.dll.meta" Type="0"/> - <ROW Component="turbojpeg.dll.meta_1" ComponentId="{DC08A77B-7BFA-4518-8694-AA5C3FB7306A}" Directory_="win7x86_Dir" Attributes="0" KeyPath="turbojpeg.dll.meta_1" Type="0"/> - <ROW Component="turbojpeg.dll_1" ComponentId="{C93ECFB0-1796-49CD-9897-B5FDED741327}" Directory_="win7x86_Dir" Attributes="0" KeyPath="turbojpeg.dll_1"/> + <ROW Component="turbojpeg.dll" ComponentId="{8CDBC3A7-72CF-42B5-A1E2-6A546607DCE0}" Directory_="win7x64_Dir" Attributes="256" KeyPath="turbojpeg.dll"/> + <ROW Component="turbojpeg.dll.meta" ComponentId="{C65078EA-8438-4FF7-BFE1-68D532764AFF}" Directory_="win7x64_Dir" Attributes="0" KeyPath="turbojpeg.dll.meta" Type="0"/> + <ROW Component="turbojpeg.dll.meta_1" ComponentId="{C3B04D4B-D79F-4FBC-881B-C7E1364935B7}" Directory_="win7x86_Dir" Attributes="0" KeyPath="turbojpeg.dll.meta_1" Type="0"/> + <ROW Component="turbojpeg.dll_1" ComponentId="{7D89438D-86DD-4300-924C-49676B63DDD7}" Directory_="win7x86_Dir" Attributes="0" KeyPath="turbojpeg.dll_1"/> <ROW Component="ucrtbased.dll" ComponentId="{4188BB88-A714-488A-A02D-98710ACC94F5}" Directory_="APPDIR" Attributes="0" KeyPath="ucrtbased.dll"/> <ROW Component="vcruntime140.dll" ComponentId="{078A42AF-E964-4CA3-8A9C-CBE6D0FD76AA}" Directory_="APPDIR" Attributes="0" KeyPath="vcruntime140.dll"/> <ROW Component="vcruntime140d.dll" ComponentId="{AF42196B-67BB-4EBA-8C3A-38B9527F9775}" Directory_="APPDIR" Attributes="0" KeyPath="vcruntime140d.dll"/> @@ -755,16 +761,27 @@ <ROW File="Tango.Insights.pdb" Component_="Tango.Insights.dll" FileName="TANGOI~2.PDB|Tango.Insights.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.Insights.pdb" SelfReg="false"/> <ROW File="Tango.FSE.LogViewer.UI.exe.config" Component_="Dragablz.xml" FileName="TANGO~10.CON|Tango.FSE.LogViewer.UI.exe.config" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.LogViewer.UI.exe.config" SelfReg="false"/> <ROW File="Tango.FSE.LogViewer.UI.pdb" Component_="Tango.FSE.LogViewer.UI.exe" FileName="TANGO~12.PDB|Tango.FSE.LogViewer.UI.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.LogViewer.UI.pdb" SelfReg="false"/> + <ROW File="DeviceId.dll" Component_="DeviceId.dll" FileName="DeviceId.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\DeviceId.dll" SelfReg="false"/> + <ROW File="CommandLine.dll" Component_="CommandLine.dll" FileName="COMMAN~1.DLL|CommandLine.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\CommandLine.dll" SelfReg="false"/> + <ROW File="ConsoleTables.dll" Component_="ConsoleTables.dll" FileName="CONSOL~1.DLL|ConsoleTables.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\ConsoleTables.dll" SelfReg="false"/> + <ROW File="dsUtil.exe" Component_="dsUtil.exe" FileName="dsUtil.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\dsUtil.exe" SelfReg="false" DigSign="true"/> + <ROW File="dsUtil.exe.config" Component_="Dragablz.xml" FileName="DSUTIL~1.CON|dsUtil.exe.config" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\dsUtil.exe.config" SelfReg="false"/> + <ROW File="Tango.DataStore.dll" Component_="Tango.DataStore.dll" FileName="TANGOD~2.DLL|Tango.DataStore.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.dll" SelfReg="false"/> + <ROW File="Tango.DataStore.Editing.dll" Component_="Tango.DataStore.Editing.dll" FileName="TANGOD~5.DLL|Tango.DataStore.Editing.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.Editing.dll" SelfReg="false"/> + <ROW File="Tango.DataStore.Editing.pdb" Component_="Tango.DataStore.Editing.dll" FileName="TANGOD~2.PDB|Tango.DataStore.Editing.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.Editing.pdb" SelfReg="false"/> + <ROW File="Tango.DataStore.EF.dll" Component_="Tango.DataStore.EF.dll" FileName="TANGOD~6.DLL|Tango.DataStore.EF.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.EF.dll" SelfReg="false"/> + <ROW File="Tango.DataStore.EF.pdb" Component_="Tango.DataStore.EF.dll" FileName="TANGOD~5.PDB|Tango.DataStore.EF.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.EF.pdb" SelfReg="false"/> + <ROW File="Tango.DataStore.pdb" Component_="Tango.DataStore.dll" FileName="TANGOD~6.PDB|Tango.DataStore.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.pdb" SelfReg="false"/> + <ROW File="Tango.DataStore.Remote.dll" Component_="Tango.DataStore.Remote.dll" FileName="TANGOD~7.DLL|Tango.DataStore.Remote.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.Remote.dll" SelfReg="false"/> + <ROW File="Tango.DataStore.Remote.pdb" Component_="Tango.DataStore.Remote.dll" FileName="TANGOD~7.PDB|Tango.DataStore.Remote.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.Remote.pdb" SelfReg="false"/> + <ROW File="Tango.DataStore.xml" Component_="Dragablz.xml" FileName="TANGOD~1.XML|Tango.DataStore.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.xml" SelfReg="false"/> + <ROW File="Tango.FSE.MachineConfiguration.dll" Component_="Tango.FSE.MachineConfiguration.dll" FileName="TANGO~12.DLL|Tango.FSE.MachineConfiguration.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.MachineConfiguration.dll" SelfReg="false"/> + <ROW File="Tango.FSE.MachineConfiguration.dll.config" Component_="Dragablz.xml" FileName="TANGO~11.CON|Tango.FSE.MachineConfiguration.dll.config" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.MachineConfiguration.dll.config" SelfReg="false"/> + <ROW File="Tango.FSE.MachineConfiguration.pdb" Component_="Tango.FSE.MachineConfiguration.dll" FileName="TANGO~13.PDB|Tango.FSE.MachineConfiguration.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.MachineConfiguration.pdb" SelfReg="false"/> <ROW File="turbojpeg.dll" Component_="turbojpeg.dll" FileName="TURBOJ~1.DLL|turbojpeg.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x64\turbojpeg.dll" SelfReg="false"/> <ROW File="turbojpeg.dll.meta" Component_="turbojpeg.dll.meta" FileName="TURBOJ~1.MET|turbojpeg.dll.meta" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x64\turbojpeg.dll.meta" SelfReg="false"/> <ROW File="turbojpeg.dll_1" Component_="turbojpeg.dll_1" FileName="TURBOJ~1.DLL|turbojpeg.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x86\turbojpeg.dll" SelfReg="false"/> <ROW File="turbojpeg.dll.meta_1" Component_="turbojpeg.dll.meta_1" FileName="TURBOJ~1.MET|turbojpeg.dll.meta" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x86\turbojpeg.dll.meta" SelfReg="false"/> - <ROW File="DeviceId.dll" Component_="DeviceId.dll" FileName="DeviceId.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\DeviceId.dll" SelfReg="false"/> - <ROW File="Tango.DataStore.dll" Component_="Tango.DataStore.dll" FileName="TANGOD~2.DLL|Tango.DataStore.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.dll" SelfReg="false"/> - <ROW File="Tango.DataStore.pdb" Component_="Tango.DataStore.dll" FileName="TANGOD~2.PDB|Tango.DataStore.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.pdb" SelfReg="false"/> - <ROW File="Tango.DataStore.Remote.dll" Component_="Tango.DataStore.Remote.dll" FileName="TANGOD~5.DLL|Tango.DataStore.Remote.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.Remote.dll" SelfReg="false"/> - <ROW File="Tango.DataStore.Remote.pdb" Component_="Tango.DataStore.Remote.dll" FileName="TANGOD~5.PDB|Tango.DataStore.Remote.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.Remote.pdb" SelfReg="false"/> - <ROW File="Tango.DataStore.xml" Component_="Dragablz.xml" FileName="TANGOD~1.XML|Tango.DataStore.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DataStore.xml" SelfReg="false"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.AiRemoveFileComponent"> <ROW RemoveFile="_" Options="3"/> @@ -927,6 +944,9 @@ <ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/> <ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/> </COMPONENT> + <COMPONENT cid="caphyon.advinst.msicomp.MsiEnvComponent"> + <ROW Environment="Path" Name="=-*Path" Value="[~];[APPDIR]" Component_="dsUtil.exe"/> + </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiExtComponent"> <ROW Extension="pproj" Component_="Tango.FSE.UI.exe" ProgId_="[|Manufacturer].[|ProductName].ppro" Feature_="TangoFSE" Options="32"/> <ROW Extension="tdp" Component_="Tango.FSE.UI.exe" ProgId_="[|Manufacturer].[|ProductName].tdp" Feature_="TangoFSE" Options="32"/> @@ -1246,13 +1266,19 @@ <ROW Feature_="TangoFSE" Component_="New_Key_1"/> <ROW Feature_="TangoFSE" Component_="__287"/> <ROW Feature_="TangoFSE" Component_="__288"/> + <ROW Feature_="TangoFSE" Component_="DeviceId.dll"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll.meta"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll_1"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll.meta_1"/> - <ROW Feature_="TangoFSE" Component_="DeviceId.dll"/> + <ROW Feature_="TangoFSE" Component_="CommandLine.dll"/> + <ROW Feature_="TangoFSE" Component_="ConsoleTables.dll"/> + <ROW Feature_="TangoFSE" Component_="dsUtil.exe"/> <ROW Feature_="TangoFSE" Component_="Tango.DataStore.dll"/> + <ROW Feature_="TangoFSE" Component_="Tango.DataStore.Editing.dll"/> + <ROW Feature_="TangoFSE" Component_="Tango.DataStore.EF.dll"/> <ROW Feature_="TangoFSE" Component_="Tango.DataStore.Remote.dll"/> + <ROW Feature_="TangoFSE" Component_="Tango.FSE.MachineConfiguration.dll"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent"> <ROW Name="Tango.FSE.LogViewer.UI.exe" SourcePath="..\..\Graphics\FSE\log_viewer_icon.ico" Index="0"/> diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs new file mode 100644 index 000000000..b18476e3f --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs @@ -0,0 +1,131 @@ +using ConsoleTables; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Cryptography; +using Tango.DataStore.Web; +using Tango.Settings; +using Tango.Web; + +namespace Tango.DataStore.CLI +{ + public class DataStoreConsole + { + public void Get(GetOptions options) + { + try + { + ApplyAutoLogin(options); + + if (options.MachineSerialNumber != null) + { + Console.WriteLine($"Retrieving data store values for '{options.MachineSerialNumber}'..."); + } + else + { + Console.WriteLine("Retrieving global data store values..."); + } + + var client = CreateClient(options.Email, options.Password, options.Environment); + + var items = client.Get(options.MachineSerialNumber, options.Collection, options.Key).ToList(); + + ConsoleTable table = new ConsoleTable("COLLECTION", "KEY", "DATA TYPE", "PROTO TYPE", "STATE", "GLOBAL", "LOCAL"); + + foreach (var item in items) + { + table.AddRow(item.Collection, item.Key, item.DataType, item.ProtoMessageType != MessageType.None ? item.ProtoMessageType.ToString() : null, item.Type, item.GlobalValue.ToStringSafe().ToOneLine(), item.LocalValue.ToStringSafe().ToOneLine()); + } + + Console.WriteLine(); + Console.WriteLine("DATA STORE RESULTS:"); + Console.WriteLine(); + + table.Write(); + } + catch (Exception ex) + { + Console.WriteLine(ex.FlattenMessage()); + } + } + + public void Put(PutOptions options) + { + try + { + ApplyAutoLogin(options); + + if (options.MachineSerialNumber != null) + { + Console.WriteLine($"Storing data store value for '{options.MachineSerialNumber}'..."); + } + else + { + Console.WriteLine("Storing global data store value..."); + } + + var client = CreateClient(options.Email, options.Password, options.Environment); + + if (options.DataType == Web.DataType.Proto) + { + options.Value = options.Value.ToStringOrEmpty().Replace("'", "\""); + } + + client.Put(new DataStoreWebPutItem() + { + Collection = options.Collection, + Key = options.Key, + DataType = options.DataType, + MachineSerialNumber = options.MachineSerialNumber, + ProtoMessageType = options.ProtoMessageType, + Value = options.Value + }); + + Console.WriteLine($"Item '{options.Key}' stored successfully."); + } + catch (Exception ex) + { + Console.WriteLine(ex.FlattenMessage()); + } + } + + public void AutoLogin(LoginConfig options) + { + MachineLevelCryptographer crypt = new MachineLevelCryptographer(); + var settings = SettingsManager.Default.GetOrCreate<DataStoreUtilSettings>(); + settings.Email = options.Email; + settings.Password = crypt.Encrypt(options.Password); + settings.Save(); + } + + private void ApplyAutoLogin(OptionsBase options) + { + if (options.Email == null && options.Password == null) + { + MachineLevelCryptographer crypt = new MachineLevelCryptographer(); + var settings = SettingsManager.Default.GetOrCreate<DataStoreUtilSettings>(); + options.Email = settings.Email; + options.Password = crypt.Decrypt(settings.Password); + } + } + + private DataStoreClient CreateClient(String email, String password, DeploymentSlot slot) + { + String token = String.Empty; + + HttpClient http = new HttpClient(); + DataStoreClient dsClient = new DataStoreClient(slot.ToAddress(), http); + var response = dsClient.Login(new LoginRequest() + { + Email = email, + Password = password, + }); + http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", response.Token); + + return dsClient; + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs new file mode 100644 index 000000000..58380d231 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Settings; + +namespace Tango.DataStore.CLI +{ + public class DataStoreUtilSettings : SettingsBase + { + public String Email { get; set; } + public String Password { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs index 150756671..fd91a5722 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs @@ -4,16 +4,17 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.DataStore.Web; using Tango.Web; namespace Tango.DataStore.CLI { public class OptionsBase { - [Option(longName: "email", HelpText = "Email address.", Required = true)] + [Option(longName: "email", HelpText = "Email address.")] public String Email { get; set; } - [Option(longName: "password", HelpText = "Password.", Required = true)] + [Option(longName: "password", HelpText = "Password.")] public String Password { get; set; } [Option(longName: "env", HelpText = "The target environment.", Required = true)] @@ -45,7 +46,23 @@ namespace Tango.DataStore.CLI [Option(longName: "key", HelpText = "New or existing item key", Required = true)] public String Key { get; set; } + [Option(longName: "data-type", HelpText = "Item data type", Required = true)] + public Web.DataType DataType { get; set; } + + [Option(longName: "proto-type", HelpText = "Protobuf message type when data-type is 'Proto'.")] + public MessageType ProtoMessageType { get; set; } + [Option(longName: "value", HelpText = "Item value", Required = true)] public String Value { get; set; } } + + [Verb("login-config", HelpText = "Stores the specified credentials for use with the --auto-login flag.")] + public class LoginConfig + { + [Option(longName: "email", HelpText = "Email address.")] + public String Email { get; set; } + + [Option(longName: "password", HelpText = "Password.")] + public String Password { get; set; } + } } diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs index db4f54620..85dfbb0bb 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs @@ -19,7 +19,7 @@ namespace Tango.DataStore.CLI { var console = new DataStoreConsole(); - var result = Parser.Default.ParseArguments<GetOptions, PutOptions>(args) + var result = Parser.Default.ParseArguments<GetOptions, PutOptions, LoginConfig>(args) .WithParsed<GetOptions>((options) => { console.Get(options); @@ -28,6 +28,10 @@ namespace Tango.DataStore.CLI { console.Put(options); }) + .WithParsed<LoginConfig>((options) => + { + console.AutoLogin(options); + }) .WithNotParsed((errors) => { @@ -41,64 +45,4 @@ namespace Tango.DataStore.CLI } } } - - public class DataStoreConsole - { - public void Get(GetOptions options) - { - try - { - if (options.MachineSerialNumber != null) - { - Console.WriteLine($"Retrieving data store values for '{options.MachineSerialNumber}'..."); - } - else - { - Console.WriteLine("Retrieving global data store values..."); - } - - var client = CreateClient(options.Email, options.Password, options.Environment); - - var items = client.Get(options.MachineSerialNumber, options.Collection, options.Key).ToList(); - - ConsoleTable table = new ConsoleTable("COLLECTION", "KEY", "DATA TYPE", "STATE", "GLOBAL", "LOCAL"); - - foreach (var item in items) - { - table.AddRow(item.Collection, item.Key, item.DataType, item.Type, item.GlobalValue.ToStringSafe().ToOneLine(), item.LocalValue.ToStringSafe().ToOneLine()); - } - - Console.WriteLine(); - Console.WriteLine("DATA STORE RESULTS:"); - Console.WriteLine(); - - table.Write(); - } - catch (Exception ex) - { - Console.WriteLine(ex.FlattenMessage()); - } - } - - public void Put(PutOptions options) - { - - } - - private DataStoreClient CreateClient(String email, String password, DeploymentSlot slot) - { - String token = String.Empty; - - HttpClient http = new HttpClient(); - DataStoreClient dsClient = new DataStoreClient(slot.ToAddress(), http); - var response = dsClient.Login(new LoginRequest() - { - Email = "roy@twine-s.com", - Password = "1Creativity", - }); - http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", response.Token); - - return dsClient; - } - } } diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj index 28aab4ef7..42b0b95dc 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj @@ -63,6 +63,8 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="DataStoreUtil.cs" /> + <Compile Include="DataStoreUtilSettings.cs" /> <Compile Include="Options.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> @@ -85,6 +87,10 @@ <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> <Name>Tango.PMR</Name> </ProjectReference> + <ProjectReference Include="..\..\Tango.Settings\Tango.Settings.csproj"> + <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> + <Name>Tango.Settings</Name> + </ProjectReference> <ProjectReference Include="..\..\Tango.Web\Tango.Web.csproj"> <Project>{5001990f-977b-48ff-b217-0236a5022ad8}</Project> <Name>Tango.Web</Name> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index d8bd8791a..46f388461 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -114,7 +114,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void EditItem(DataStoreItemModel item) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreWrite)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreWrite)) { await NotificationProvider.ShowError("The current user profile does not allow editing of the data store.\nPlease contact your administrator."); return; @@ -133,7 +133,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void AddCollection() { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow creating new data store collections.\nPlease contact your administrator."); return; @@ -174,7 +174,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void AddItem() { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow creating new data store items.\nPlease contact your administrator."); return; @@ -217,7 +217,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void RemoveCollection(DataStoreCollectionModel collection) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow deleting data store collections.\nPlease contact your administrator."); return; @@ -229,7 +229,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void RemoveItem(DataStoreItemModel item) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow deleting data store items.\nPlease contact your administrator."); return; @@ -263,7 +263,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void SaveModel() { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreWrite)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreWrite)) { await NotificationProvider.ShowError("The current user profile does not allow editing of the data store.\nPlease contact your administrator."); return; @@ -332,7 +332,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { base.OnNavigatedTo(); - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreRead)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreRead)) { return; } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs index dd2430415..fd953a0b8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs @@ -33,7 +33,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { if (value == NavigationView.DataStoreView) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreRead)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreRead)) { Task.Delay(500).ContinueWith((x) => { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm Binary files differindex 8777b5768..ef7ec26c0 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm diff --git a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml index 8f06dac0d..92064f9fd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml @@ -16,7 +16,7 @@ Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <Grid> - <DataGrid Visibility="{Binding IsEmbedded,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 5 0 0" Style="{StaticResource FSE_LogsGridStyle}" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" CanUserSortColumns="True"> + <DataGrid Visibility="{Binding IsEmbedded,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 5 0 0" Style="{StaticResource FSE_LogsGridStyle}" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" CanUserSortColumns="True" CanUserResizeColumns="True"> <DataGrid.Resources> <components:BindingProxy x:Key="proxy" Data="{Binding}" /> </DataGrid.Resources> @@ -24,6 +24,7 @@ <DataGridTemplateColumn Header="#" Width="40" CellTemplate="{StaticResource FSE_LogIcon_Cell}"/> <DataGridTextColumn Header="DATE TIME" Binding="{Binding TimeStamp,StringFormat='HH:mm:ss.ff'}" Width="100" /> <DataGridTextColumn Header="SERVICE" Binding="{Binding ClassName}" Width="200" /> + <DataGridTextColumn Header="LN" Binding="{Binding CallerLineNumber}" Width="60" /> <DataGridTemplateColumn Header="MESSAGE" Width="1*" > <DataGridTemplateColumn.CellTemplate> <DataTemplate> @@ -34,7 +35,7 @@ </DataGrid.Columns> </DataGrid> - <DataGrid Visibility="{Binding IsEmbedded,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 5 0 0" Style="{StaticResource FSE_LogsGridStyle}" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" CanUserSortColumns="True"> + <DataGrid Visibility="{Binding IsEmbedded,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 5 0 0" Style="{StaticResource FSE_LogsGridStyle}" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" CanUserSortColumns="True" CanUserResizeColumns="True"> <DataGrid.Resources> <components:BindingProxy x:Key="proxy" Data="{Binding}" /> </DataGrid.Resources> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs index fa70e630e..964eb990b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs @@ -8,5 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango FSE")] -[assembly: AssemblyVersion("1.1.1.0")] - +[assembly: AssemblyVersion("1.1.1.0")] diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 4b4d46a78..2a79629a3 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -601,6 +601,10 @@ </None> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\DataStore\Tango.DataStore.CLI\Tango.DataStore.CLI.csproj"> + <Project>{6189b8c3-7af9-43dd-8a61-a8a05f526f62}</Project> + <Name>Tango.DataStore.CLI</Name> + </ProjectReference> <ProjectReference Include="..\..\PPC\Tango.PPC.Shared\Tango.PPC.Shared.csproj"> <Project>{208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}</Project> <Name>Tango.PPC.Shared</Name> diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs b/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs index 5bf6095f5..51e98f6f4 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs @@ -305,19 +305,19 @@ namespace Tango.BL.Enumerations /// (Allows viewing data store items) /// </summary> [Description("Allows viewing data store items")] - FSE_DataStoreRead = 1026, + DataStoreRead = 1026, /// <summary> /// (Allows writing to data store items) /// </summary> [Description("Allows writing to data store items")] - FSE_DataStoreWrite = 1027, + DataStoreWrite = 1027, /// <summary> /// (Allows creating data store items and collections) /// </summary> [Description("Allows creating data store items and collections")] - FSE_DataStoreCreate = 1028, + DataStoreCreate = 1028, /// <summary> /// (Allows resetting the machine counters) @@ -331,5 +331,11 @@ namespace Tango.BL.Enumerations [Description("Allows resetting the machine device registration")] FSE_ResetMachineDeviceRegistration = 1030, + /// <summary> + /// (Allows creating creating and editing the global data store) + /// </summary> + [Description("Allows creating creating and editing the global data store")] + DataStoreCreateWriteGlobal = 1031, + } } diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs index 0d35bd776..383a59850 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs @@ -62,6 +62,11 @@ namespace Tango.MachineService.Controllers throw new AuthenticationException("Your account has been disabled. Please contact your administrator."); } + if (!user.HasPermission(Permissions.DataStoreRead)) + { + throw new AuthenticationException("You are not authorized to access the data store."); + } + var token = WebToken<TokenObject>.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject() { UserGuid = user.Guid, @@ -81,7 +86,7 @@ namespace Tango.MachineService.Controllers { try { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreRead)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreRead)) { throw CreateHttpException(new AuthenticationException("The current user was not authorized to read from the data store."), HttpStatusCode.Unauthorized); } @@ -150,9 +155,9 @@ namespace Tango.MachineService.Controllers { try { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreWrite)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreWrite)) { - throw CreateHttpException(new AuthenticationException("The current user was not authorized to write to the data store."), HttpStatusCode.BadRequest); + throw CreateHttpException(new AuthenticationException("The current user was not authorized to write to the data store."), HttpStatusCode.Unauthorized); } if (item.Collection == null || item.Key == null) @@ -177,7 +182,7 @@ namespace Tango.MachineService.Controllers if (dbItem == null) { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreCreate)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreCreate)) { throw CreateHttpException(new AuthenticationException("The current user was not authorized to create new items on the data store."), HttpStatusCode.Unauthorized); } @@ -197,11 +202,16 @@ namespace Tango.MachineService.Controllers } else { + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreCreateWriteGlobal)) + { + throw CreateHttpException(new AuthenticationException("The current user was not authorized to write to the global data store."), HttpStatusCode.Unauthorized); + } + GlobalDataStoreItem dbItem = db.GlobalDataStoreItems.FirstOrDefault(x => x.CollectionName == item.Collection && x.Key == item.Key); if (dbItem == null) { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreCreate)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreCreate)) { throw CreateHttpException(new AuthenticationException("The current user was not authorized to create new items on the data store."), HttpStatusCode.Unauthorized); } |
