diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 6b1e6ff6..86bfc03a 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Config/ServerConfigController.cs b/Step.Config/ServerConfigController.cs index b4125b6d..fc973d2d 100644 --- a/Step.Config/ServerConfigController.cs +++ b/Step.Config/ServerConfigController.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Xml.Linq; using System.Xml.Schema; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Config { @@ -130,6 +130,7 @@ namespace Step.Config return ScadaConfig.Enabled; case AREAS.GENERAL_KEY: + case AREAS.UNDER_HOOD: return true; default: diff --git a/Step.Database/DatabaseContext.cs b/Step.Database/DatabaseContext.cs index 6282dbc6..e629d0eb 100644 --- a/Step.Database/DatabaseContext.cs +++ b/Step.Database/DatabaseContext.cs @@ -9,7 +9,7 @@ using System.Data.Entity.Migrations; using System.IO; using System.Linq; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; using static Step.Utils.ExceptionManager; namespace Step.Database diff --git a/Step.Database/Migrations/Configuration.cs b/Step.Database/Migrations/Configuration.cs index 9dbdacaa..fe663d78 100644 --- a/Step.Database/Migrations/Configuration.cs +++ b/Step.Database/Migrations/Configuration.cs @@ -2,7 +2,8 @@ namespace Step.Database.Migrations { using Step.Model.DatabaseModels; using System.Data.Entity.Migrations; - using static Step.Utils.Constants; + using static Step.Model.Constants.FUNCTIONALITY_NAMES; + using static Step.Model.Constants.AREAS; public sealed class Configuration : DbMigrationsConfiguration { @@ -23,11 +24,17 @@ namespace Step.Database.Migrations context.FunctionsAccess.AddOrUpdate( // General Function - new FunctionAccessModel() { FunctionAccessId = 1, Name = "general", Area = AREAS.GENERAL_KEY, Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1, PlcId = -1 }, - new FunctionAccessModel() { FunctionAccessId = 2, Name = "userFunctions", Area = AREAS.GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = -1 }, - new FunctionAccessModel() { FunctionAccessId = 3, Name = "ncData", Area = AREAS.GENERAL_KEY, Enabled = true, WriteLevelMin = 10, ReadLevelMin = 1, PlcId = -1 }, - new FunctionAccessModel() { FunctionAccessId = 4, Name = "startupIcons", Area = AREAS.GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 }, - new FunctionAccessModel() { FunctionAccessId = 5, Name = "alarmCmd", Area = AREAS.GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1 } + new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1, PlcId = -1 }, + new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = -1 }, + new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 10, ReadLevelMin = 1, PlcId = -1 }, + new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 }, + new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1 }, + + // Under hood + new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2 }, + new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3 }, + new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4 }, + new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5 } ); context.SaveChanges(); diff --git a/Step.Model/ConfigModels/HeadsConfigModel.cs b/Step.Model/ConfigModels/HeadsConfigModel.cs index b318040d..c8fad081 100644 --- a/Step.Model/ConfigModels/HeadsConfigModel.cs +++ b/Step.Model/ConfigModels/HeadsConfigModel.cs @@ -1,4 +1,4 @@ -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Model.ConfigModels { diff --git a/Step.Model/ConfigModels/SoftKeyConfigModel.cs b/Step.Model/ConfigModels/SoftKeyConfigModel.cs index 54a5bf6a..766a9572 100644 --- a/Step.Model/ConfigModels/SoftKeyConfigModel.cs +++ b/Step.Model/ConfigModels/SoftKeyConfigModel.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Model.ConfigModels { diff --git a/Step.Model/Constants.cs b/Step.Model/Constants.cs index 04c3f031..e53866f7 100644 --- a/Step.Model/Constants.cs +++ b/Step.Model/Constants.cs @@ -2,7 +2,7 @@ using System.IO; using System.Reflection; -namespace Step.Utils +namespace Step.Model { public static class Constants { @@ -72,6 +72,7 @@ namespace Step.Utils public const string UTILITIES_KEY = "utilities"; public const string SCADA_KEY = "scada"; public const string GENERAL_KEY = "general"; + public const string UNDER_HOOD = "underHood"; } // Filenames @@ -130,5 +131,19 @@ namespace Step.Utils public const string MAINT_MACHINE_INTERVAL_TYPE = "machine_interval"; public const string MAINT_TIME_INTERVAL_TYPE = "time_interval"; public const string MAINT_EXPIRATION_DATE_TYPE = "exp_date"; + + + public static class FUNCTIONALITY_NAMES + { + public const string GENERAL = "general"; + public const string USER_FUNCTIONS = "userFunctions"; + public const string NC_DATA = "ncData"; + public const string ALARM_CMD = "alarmCmd"; + public const string STARTUP_ICONS = "startupIcons"; + public const string PROCESS_CMD = "processCmd"; + public const string NC_SOFTKEY = "ncSoftkeys"; + public const string USER_SOFTKEY = "userSoftkeys"; + public const string HEADS_CMD = "headsCms"; + } } } diff --git a/Step.Model/DTOModels/DTOAxesModel.cs b/Step.Model/DTOModels/DTOAxesModel.cs index 910915c6..2125ed17 100644 --- a/Step.Model/DTOModels/DTOAxesModel.cs +++ b/Step.Model/DTOModels/DTOAxesModel.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Step.Model.DTOModels { @@ -35,8 +31,7 @@ namespace Step.Model.DTOModels if (item == null) return false; - return base.Equals(obj); } } -} +} \ No newline at end of file diff --git a/Step.Model/DTOModels/DTOClientConfigurationModel.cs b/Step.Model/DTOModels/DTOClientConfigurationModel.cs index 1d3f759d..644212d0 100644 --- a/Step.Model/DTOModels/DTOClientConfigurationModel.cs +++ b/Step.Model/DTOModels/DTOClientConfigurationModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Globalization; namespace Step.Model.DTOModels { @@ -30,4 +25,4 @@ namespace Step.Model.DTOModels } } } -} +} \ No newline at end of file diff --git a/Step.Model/DTOModels/DTOHeadsConfigModel.cs b/Step.Model/DTOModels/DTOHeadsConfigModel.cs new file mode 100644 index 00000000..51671645 --- /dev/null +++ b/Step.Model/DTOModels/DTOHeadsConfigModel.cs @@ -0,0 +1,9 @@ +namespace Step.Model.DTOModels +{ + public class DTOHeadsConfigModel + { + public int Id; + public string Name; + public string Type; + } +} \ No newline at end of file diff --git a/Step.Model/DTOModels/DTOLanguageModel.cs b/Step.Model/DTOModels/DTOLanguageModel.cs index 586475de..c41ae22f 100644 --- a/Step.Model/DTOModels/DTOLanguageModel.cs +++ b/Step.Model/DTOModels/DTOLanguageModel.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Step.Model.DTOModels +namespace Step.Model.DTOModels { public class DTOLanguageModel { public string Name; public string IsoId; } -} +} \ No newline at end of file diff --git a/Step.Model/DTOModels/DTONcGenericDataModel.cs b/Step.Model/DTOModels/DTONcGenericDataModel.cs index 361d27c0..dac0aa57 100644 --- a/Step.Model/DTOModels/DTONcGenericDataModel.cs +++ b/Step.Model/DTOModels/DTONcGenericDataModel.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; namespace Step.Model.DTOModels { @@ -34,4 +29,4 @@ namespace Step.Model.DTOModels CoreLibraryVersion = "2.0.0"; } } -} +} \ No newline at end of file diff --git a/Step.Model/DTOModels/DTOSoftKeyModel.cs b/Step.Model/DTOModels/DTOSoftKeyModel.cs index c2e3072e..214670c2 100644 --- a/Step.Model/DTOModels/DTOSoftKeyModel.cs +++ b/Step.Model/DTOModels/DTOSoftKeyModel.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Model.DTOModels { diff --git a/Step.Model/Step.Model.csproj b/Step.Model/Step.Model.csproj index c72f049f..ccc33061 100644 --- a/Step.Model/Step.Model.csproj +++ b/Step.Model/Step.Model.csproj @@ -84,6 +84,7 @@ + DtsGenerator DTOLanguageModel.cs.d.ts diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index dd5b6a1d..ff7583c0 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -12,8 +12,7 @@ using System.Globalization; using static CMS_CORE.Nc; using static CMS_CORE_Library.DataStructures; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; -using static Step.Utils.SupportFunctions; +using static Step.Model.Constants; namespace Step.NC { @@ -577,6 +576,16 @@ namespace Step.NC return numericalControl.PROC_WSelectProcess(procNumber); } + public CmsError PutOverride(uint id, string action) + { + HEAD_OVERRIDE_SIGN sign = HEAD_OVERRIDE_SIGN.MINUS; + if (action == "plus") + sign = HEAD_OVERRIDE_SIGN.PLUS; + + CmsError cmsError = numericalControl.PLC_WHeadOverride(id, sign); + return cmsError; + } + public CmsError PutPowerOnData(uint id) { // Set to true power on data by id diff --git a/Step.Tasks/ThreadsFunctions.cs b/Step.Tasks/ThreadsFunctions.cs index 2e5704ac..19b444cf 100644 --- a/Step.Tasks/ThreadsFunctions.cs +++ b/Step.Tasks/ThreadsFunctions.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.Threading; using TeamDev.SDK.MVVM; using static CMS_CORE_Library.DataStructures; -using static Step.Utils.Constants; +using static Step.Model.Constants; using static Step.Utils.ExceptionManager; public static class ThreadsFunctions diff --git a/Step.Tasks/ThreadsHandler.cs b/Step.Tasks/ThreadsHandler.cs index d1eefc0d..cd362592 100644 --- a/Step.Tasks/ThreadsHandler.cs +++ b/Step.Tasks/ThreadsHandler.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Threading; using TeamDev.SDK.MVVM; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Core { diff --git a/Step.UI/ServerControlWindow.cs b/Step.UI/ServerControlWindow.cs index 327e5459..08458d99 100644 --- a/Step.UI/ServerControlWindow.cs +++ b/Step.UI/ServerControlWindow.cs @@ -9,7 +9,7 @@ using System.Threading; using System.Windows.Forms; using TeamDev.SDK.MVVM; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.UI { diff --git a/Step.Utils/ExceptionManager.cs b/Step.Utils/ExceptionManager.cs index fb3c9f13..9e5b1612 100644 --- a/Step.Utils/ExceptionManager.cs +++ b/Step.Utils/ExceptionManager.cs @@ -2,7 +2,7 @@ using System.Windows.Forms; using Step.Model; using TeamDev.SDK.MVVM; -using static Step.Utils.Constants; +using static Step.Model.Constants; using static Step.Utils.StepLogger; namespace Step.Utils diff --git a/Step.Utils/LanguageController.cs b/Step.Utils/LanguageController.cs index 4fe07744..b06a606b 100644 --- a/Step.Utils/LanguageController.cs +++ b/Step.Utils/LanguageController.cs @@ -5,7 +5,7 @@ using System.IO; using System.Linq; using System.Xml.Linq; using System.Xml.Schema; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Utils { diff --git a/Step.Utils/StepLogger.cs b/Step.Utils/StepLogger.cs index b2db30f7..9efdb7db 100644 --- a/Step.Utils/StepLogger.cs +++ b/Step.Utils/StepLogger.cs @@ -1,6 +1,6 @@ using NLog; using System; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Utils { diff --git a/Step.Utils/supportFunctions.cs b/Step.Utils/supportFunctions.cs index b6b091d3..b92fdc87 100644 --- a/Step.Utils/supportFunctions.cs +++ b/Step.Utils/supportFunctions.cs @@ -1,4 +1,4 @@ -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Utils { diff --git a/Step/App_Start/Startup.cs b/Step/App_Start/Startup.cs index b5af3767..74d337ae 100644 --- a/Step/App_Start/Startup.cs +++ b/Step/App_Start/Startup.cs @@ -14,6 +14,7 @@ using System.Net; using System.Net.NetworkInformation; using System.Web.Http; using static Step.Config.ServerConfig; +using static Step.Model.Constants; [assembly: OwinStartup(typeof(Step.App_Start.Startup))] @@ -44,21 +45,21 @@ namespace Step.App_Start var directoryBrowsing = ConfigurationManager.AppSettings["enableDirectoryBrowsing"] == "true"; // Check if web site directory exists - if (!Directory.Exists(Constants.WEBSITE_DIRECTORY)) - ExceptionManager.Manage(Constants.ERROR_LEVEL.FATAL, "Main window directory not found!"); + if (!Directory.Exists(WEBSITE_DIRECTORY)) + ExceptionManager.Manage(ERROR_LEVEL.FATAL, "Main window directory not found!"); var options = new FileServerOptions() { EnableDefaultFiles = !directoryBrowsing, EnableDirectoryBrowsing = directoryBrowsing, RequestPath = PathString.Empty, - FileSystem = new PhysicalFileSystem(Constants.WEBSITE_DIRECTORY) + FileSystem = new PhysicalFileSystem(WEBSITE_DIRECTORY) }; app.UseFileServer(options); if (!ServerPortIsAvailable(ServerStartupConfig.ServerPort)) { - ExceptionManager.Manage(Constants.ERROR_LEVEL.FATAL, "Server port is already in use by another process"); + ExceptionManager.Manage(ERROR_LEVEL.FATAL, "Server port is already in use by another process"); } } diff --git a/Step/Attributes/SignalRAuthorizeAttribute.cs b/Step/Attributes/SignalRAuthorizeAttribute.cs index b8917320..0721338e 100644 --- a/Step/Attributes/SignalRAuthorizeAttribute.cs +++ b/Step/Attributes/SignalRAuthorizeAttribute.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Security.Claims; using System.Security.Principal; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Attributes { diff --git a/Step/Attributes/WebApiAuthorizeAttribute.cs b/Step/Attributes/WebApiAuthorizeAttribute.cs index 0e4f1be4..d5877b5b 100644 --- a/Step/Attributes/WebApiAuthorizeAttribute.cs +++ b/Step/Attributes/WebApiAuthorizeAttribute.cs @@ -5,9 +5,9 @@ using System.Web.Http; using System.Web.Http.Controllers; using Step.Database.Controllers; using Step.Config; -using static Step.Utils.Constants; using Step.Model.DatabaseModels; using static Step.Config.ServerConfig; +using static Step.Model.Constants; namespace Step { diff --git a/Step/Controllers/SignalR/NcHub.cs b/Step/Controllers/SignalR/NcHub.cs index 12c8b287..7126abf3 100644 --- a/Step/Controllers/SignalR/NcHub.cs +++ b/Step/Controllers/SignalR/NcHub.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using TeamDev.SDK.MVVM; using static CMS_CORE_Library.DataStructures; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Controllers.SignalR { @@ -128,5 +128,29 @@ namespace Step.Controllers.SignalR throw new HubException(libraryError.message); } } + + public void AddOverride(uint id) + { + using (NcHandler ncHandler = new NcHandler()) + { + CmsError libraryError = ncHandler.Connect(); + if (libraryError.IsError()) + throw new HubException(libraryError.message); + + libraryError = ncHandler.PutOverride(id, "plus"); + } + } + + public void SubOverride(uint id) + { + using (NcHandler ncHandler = new NcHandler()) + { + CmsError libraryError = ncHandler.Connect(); + if (libraryError.IsError()) + throw new HubException(libraryError.message); + + libraryError = ncHandler.PutOverride(id, "minus"); + } + } } } \ No newline at end of file diff --git a/Step/Controllers/WebApi/AuthorizationController.cs b/Step/Controllers/WebApi/AuthorizationController.cs index 371da28d..bd2a5334 100644 --- a/Step/Controllers/WebApi/AuthorizationController.cs +++ b/Step/Controllers/WebApi/AuthorizationController.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Web.Http; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Controllers.WebApi { @@ -13,7 +13,7 @@ namespace Step.Controllers.WebApi public class AuthorizationController : ApiController { [Route("functions"), HttpGet] - [WebApiAuthorize(FunctionAccess = "functionAccess", Action = ACTIONS.READ)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.GENERAL, Action = ACTIONS.READ)] public IHttpActionResult GetFunctionsConfig() { using (FunctionsAccessController acController = new FunctionsAccessController()) diff --git a/Step/Controllers/WebApi/ConfigurationController.cs b/Step/Controllers/WebApi/ConfigurationController.cs index 24b79960..80b91c61 100644 --- a/Step/Controllers/WebApi/ConfigurationController.cs +++ b/Step/Controllers/WebApi/ConfigurationController.cs @@ -1,9 +1,10 @@ using Step.Model.ConfigModels; using Step.Model.DTOModels; using System.Collections.Generic; +using System.Linq; using System.Web.Http; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Controllers.WebApi { @@ -83,7 +84,14 @@ namespace Step.Controllers.WebApi [Route("heads"), HttpGet] public IHttpActionResult GetHeadConfig() { - return Ok(HeadsConfig); + List heads = HeadsConfig.Select(x => new DTOHeadsConfigModel() + { + Id = x.Id, + Name = x.Name, + Type = x.Type.ToString() + }).ToList(); + + return Ok(heads); } } } \ No newline at end of file diff --git a/Step/Controllers/WebApi/LanguageController.cs b/Step/Controllers/WebApi/LanguageController.cs index f1b81ed5..7623faaf 100644 --- a/Step/Controllers/WebApi/LanguageController.cs +++ b/Step/Controllers/WebApi/LanguageController.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Web.Http; using static CMS_CORE_Library.DataStructures; using static Step.Config.ServerConfig; -using static Step.Utils.Constants; +using static Step.Model.Constants; using static Step.Utils.LanguageController; namespace Step.Controllers.WebApi diff --git a/Step/Controllers/WebApi/NcApiController.cs b/Step/Controllers/WebApi/NcApiController.cs index 9a9114c1..b148eb27 100644 --- a/Step/Controllers/WebApi/NcApiController.cs +++ b/Step/Controllers/WebApi/NcApiController.cs @@ -4,7 +4,7 @@ using System; using System.Diagnostics; using System.Web.Http; using static CMS_CORE_Library.DataStructures; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Controllers.WebApi { @@ -12,7 +12,7 @@ namespace Step.Controllers.WebApi public class NcApiController : ApiController { [Route("generic_data"), HttpGet] - [WebApiAuthorize(FunctionAccess = "ncData", Action = ACTIONS.READ)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.NC_DATA, Action = ACTIONS.READ)] public IHttpActionResult GetNcGenericData() { Stopwatch stop = new Stopwatch(); diff --git a/Step/Controllers/WebApi/UserController.cs b/Step/Controllers/WebApi/UserController.cs index 1bb3b793..e04cebe7 100644 --- a/Step/Controllers/WebApi/UserController.cs +++ b/Step/Controllers/WebApi/UserController.cs @@ -7,7 +7,7 @@ using System.Globalization; using System.Linq; using System.Security.Claims; using System.Web.Http; -using static Step.Utils.Constants; +using static Step.Model.Constants; using static Step.Utils.LanguageController; namespace Step.Controllers.WebApi @@ -16,7 +16,7 @@ namespace Step.Controllers.WebApi public class UserController : ApiController { [Route("logout"), HttpPost] - [WebApiAuthorize(FunctionAccess = "userFunctions", Action = ACTIONS.WRITE)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.USER_FUNCTIONS, Action = ACTIONS.WRITE)] public IHttpActionResult Logout() { var identity = User.Identity as ClaimsIdentity; @@ -49,7 +49,7 @@ namespace Step.Controllers.WebApi } [Route("info"), HttpGet] - [WebApiAuthorize(FunctionAccess = "userFunctions", Action = ACTIONS.READ)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.USER_FUNCTIONS, Action = ACTIONS.READ)] public IHttpActionResult UserInfo() { var identity = User.Identity as ClaimsIdentity; @@ -65,7 +65,7 @@ namespace Step.Controllers.WebApi } [Route("language"), HttpPut] - [WebApiAuthorize(FunctionAccess = "userFunctions", Action = ACTIONS.READ)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.USER_FUNCTIONS, Action = ACTIONS.READ)] public IHttpActionResult PutUserLanguage([FromBody] dynamic user) { // If no body return 400 diff --git a/Step/Listeners/ListenersHandler.cs b/Step/Listeners/ListenersHandler.cs index 1d8f7c5e..4bca0e3b 100644 --- a/Step/Listeners/ListenersHandler.cs +++ b/Step/Listeners/ListenersHandler.cs @@ -3,7 +3,7 @@ using Step.Listeners.SignalR; using Step.Model.DTOModels; using System.Collections.Generic; using TeamDev.SDK.MVVM; -using static Step.Utils.Constants; +using static Step.Model.Constants; namespace Step.Listeners { diff --git a/Step/Provider/ApplicationOAuthProvider.cs b/Step/Provider/ApplicationOAuthProvider.cs index 54a22277..f1338e4a 100644 --- a/Step/Provider/ApplicationOAuthProvider.cs +++ b/Step/Provider/ApplicationOAuthProvider.cs @@ -4,7 +4,7 @@ using Microsoft.Owin.Security.OAuth; using Step.Database.Controllers; using Step.Model.DatabaseModels; using System.Security.Claims; -using static Step.Utils.Constants; +using static Step.Model.Constants; using static Step.Config.ServerConfig; using System.Linq; diff --git a/Step/program.cs b/Step/program.cs index 6d7db19b..bf468c70 100644 --- a/Step/program.cs +++ b/Step/program.cs @@ -5,7 +5,7 @@ using TeamDev.SDK.MVVM; using Step.Config; using static Step.Config.ServerConfig; using static Step.Utils.StepLogger; -using static Step.Utils.Constants; +using static Step.Model.Constants; using Step.Database; using Step.Core; using Step.Listeners;