mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:06:30 +00:00
add offset
fixes add visual validation border and validate functionality
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace Azaion.Common.Extensions;
|
||||
|
||||
public static class EnumerableExtensions
|
||||
{
|
||||
public static bool In<T>(this T obj, params T[] objects) =>
|
||||
objects.Contains(obj);
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Azaion.CommonSecurity.DTO;
|
||||
using Azaion.Common.Extensions;
|
||||
|
||||
namespace Azaion.CommonSecurity.DTO;
|
||||
|
||||
public enum RoleEnum
|
||||
{
|
||||
@@ -10,3 +12,9 @@ public enum RoleEnum
|
||||
ResourceUploader = 50, //Uploading dll and ai models
|
||||
ApiAdmin = 1000 //everything
|
||||
}
|
||||
|
||||
public static class RoleEnumExtensions
|
||||
{
|
||||
public static bool IsValidator(this RoleEnum role) =>
|
||||
role.In(RoleEnum.Validator, RoleEnum.Admin, RoleEnum.ApiAdmin);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ public class SecurityConstants
|
||||
{
|
||||
public const string CONFIG_PATH = "config.json";
|
||||
|
||||
public const string DUMMY_DIR = "dummy";
|
||||
#region ApiConfig
|
||||
|
||||
public const string DEFAULT_API_URL = "https://api.azaion.com/";
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ResourceLoader(AzaionApiClient api, ApiCredentials credentials) : I
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
var currentLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
|
||||
var dllPath = Path.Combine(currentLocation, "dummy", $"{assemblyName}.dll");
|
||||
var dllPath = Path.Combine(currentLocation, SecurityConstants.DUMMY_DIR, $"{assemblyName}.dll");
|
||||
return Assembly.LoadFile(dllPath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user