a05c3aeb85
Added signalR auth
33 lines
764 B
C#
33 lines
764 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Web.Helpers;
|
|
using Step.Model;
|
|
|
|
namespace Step.Database.Controllers
|
|
{
|
|
public class FunctionAccessController : IDisposable
|
|
{
|
|
private DatabaseContext dbCtx;
|
|
|
|
public FunctionAccessController()
|
|
{
|
|
// Initialize database context
|
|
dbCtx = new DatabaseContext();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
// Clear database context
|
|
dbCtx.Dispose();
|
|
}
|
|
|
|
public FunctionAccessModel FindEnabledFunctionByName(string functionName)
|
|
{
|
|
return dbCtx
|
|
.FunctionsAccess
|
|
.Where(x => x.Name == functionName && x.Enabled == true)
|
|
.FirstOrDefault();
|
|
}
|
|
}
|
|
}
|