aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEController.cs20
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEDownloadsController.cs11
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Models/FSEPendingUpload.cs2
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs2
4 files changed, 27 insertions, 8 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEController.cs
index b9dacfcf9..38c75934a 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEController.cs
@@ -84,6 +84,16 @@ namespace Tango.MachineService.Controllers
throw new AuthenticationException("Your account has been disabled. Please contact your administrator.");
}
+ if (request.Build == BuildVariants.FSE && !user.HasPermission(Permissions.FSE_RunFSE))
+ {
+ throw new AuthenticationException("You do not have permission to access Tango FSE. Please contact your administrator.");
+ }
+
+ if (request.Build == BuildVariants.TwineStudio && !user.HasPermission(Permissions.TwineStudioAccess))
+ {
+ throw new AuthenticationException("You do not have permission to access Twine Studio. Please contact your administrator.");
+ }
+
user.LastLogin = DateTime.UtcNow;
db.SaveChanges();
}
@@ -190,7 +200,7 @@ namespace Tango.MachineService.Controllers
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
- var versions = db.FseVersions.ToList();
+ var versions = db.FseVersions.ToList().Where(x => x.BuildVariant == request.Build.ToInt32()).ToList();
FseVersion latestVersion = null;
@@ -336,7 +346,7 @@ namespace Tango.MachineService.Controllers
{
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
- var version = db.FseVersions.ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault();
+ var version = db.FseVersions.ToList().Where(x => x.BuildVariant == request.Build.ToInt32()).OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault();
return new LatestVersionResponse() { Version = version != null ? version.Version : "0.0.0.0" };
}
}
@@ -356,7 +366,7 @@ namespace Tango.MachineService.Controllers
if (user != null && user.HasPermission(Permissions.PublishMachineStudioVersions))
{
- var latestVersion = db.FseVersions.ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault();
+ var latestVersion = db.FseVersions.ToList().Where(x => x.BuildVariant == request.Build.ToInt32()).ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault();
Version local_version = Version.Parse(request.Version);
if (latestVersion == null || local_version > Version.Parse(latestVersion.Version))
@@ -375,7 +385,8 @@ namespace Tango.MachineService.Controllers
Token = response.Token,
Version = request.Version,
BlobName = "BLOB",
- InstallerBlobName = installerBlob.Name
+ InstallerBlobName = installerBlob.Name,
+ BuildVariant = request.Build.ToInt32()
};
_pendingUploads.Add(pending_upload);
@@ -413,6 +424,7 @@ namespace Tango.MachineService.Controllers
InstallerBlobName = upload.InstallerBlobName,
UserGuid = upload.UserGuid,
Version = upload.Version,
+ BuildVariant = upload.BuildVariant
});
db.SaveChanges();
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEDownloadsController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEDownloadsController.cs
index 52eb2bbb5..6c28d93ef 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEDownloadsController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/FSEDownloadsController.cs
@@ -16,29 +16,34 @@ using System.Net;
using System.Net.Http.Headers;
using System.Net.Mime;
using Tango.MachineService.Views.FSEDownloads;
+using Tango.BL.Enumerations;
namespace Tango.MachineService.Controllers
{
public class FSEDownloadsController : Controller
{
- public ActionResult Index()
+ public ActionResult Index(int? buildVariant = 0)
{
IndexViewModel model = new IndexViewModel();
using (var db = ObservablesContextHelper.CreateContext())
{
- var versions = db.FseVersions.ToList().OrderByDescending(x => Version.Parse(x.Version)).Take(6).ToList();
+ int build = buildVariant.Value;
+
+ var versions = db.FseVersions.Where(x => x.BuildVariant == build).ToList().OrderByDescending(x => Version.Parse(x.Version)).Take(6).ToList();
var manager = new BlobStorageManager();
var container = manager.GetContainer(MachineServiceConfig.FSE_VERSIONS_CONTAINER);
+ String appName = ((FSEBuildVariants)build) == FSEBuildVariants.FSE ? "Tango FSE" : "Twine Studio";
+
foreach (var item in versions)
{
var installerBlob = container.GetBlockBlobReference(item.InstallerBlobName);
model.Downloads.Add(new FSEDownload()
{
- Name = $"Tango FSE v{Version.Parse(item.Version).ToString(3)}",
+ Name = $"{appName} v{Version.Parse(item.Version).ToString(3)}",
Version = Version.Parse(item.Version).ToString(3),
Comments = item.Comments,
Date = item.LastUpdated.ToString("dddd, dd MMMM yyyy"),
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Models/FSEPendingUpload.cs b/Software/Visual_Studio/Web/Tango.MachineService/Models/FSEPendingUpload.cs
index 7bb74d045..a33ccfaae 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Models/FSEPendingUpload.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Models/FSEPendingUpload.cs
@@ -18,5 +18,7 @@ namespace Tango.MachineService.Models
public String BlobName { get; set; }
public String InstallerBlobName { get; set; }
+
+ public int BuildVariant { get; set; }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs
index 3045818b0..0353e2df2 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs
@@ -24,4 +24,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("3.0.13.0")]
+[assembly: AssemblyVersion("3.0.14.0")]