This commit is contained in:
20
server/AyaNova/DataList/DataListFactory.cs
Normal file
20
server/AyaNova/DataList/DataListFactory.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.DataList
|
||||||
|
{
|
||||||
|
internal static class DataListFactory
|
||||||
|
{
|
||||||
|
internal const string TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY = "TEST_WIDGET_USER_EMAIL_ADDRESS_LIST";//for development testing, not a real thing going forward
|
||||||
|
|
||||||
|
internal static IAyaDataList GetAyaDataList(string ListKey)
|
||||||
|
{
|
||||||
|
switch (ListKey)
|
||||||
|
{
|
||||||
|
case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY:
|
||||||
|
return new TestWidgetUserEmail();
|
||||||
|
default:
|
||||||
|
throw new System.ArgumentOutOfRangeException($"DataListFactory: Unknown key \"{ListKey}\"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
56
server/AyaNova/DataList/TestWidgetUserEmail.cs
Normal file
56
server/AyaNova/DataList/TestWidgetUserEmail.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.DataList
|
||||||
|
{
|
||||||
|
internal class TestWidgetUserEmail : IAyaDataList
|
||||||
|
{
|
||||||
|
|
||||||
|
public string ListKey => DataListFactory.TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY;
|
||||||
|
|
||||||
|
public string SQLFrom => "throw new System.NotImplementedException()";
|
||||||
|
|
||||||
|
public List<AyaDataListFieldDefinition> FieldDefinitions
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
List<AyaDataListFieldDefinition> l = new List<AyaDataListFieldDefinition>();
|
||||||
|
l.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id" });
|
||||||
|
l.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "widgetname",
|
||||||
|
LtKey = "WidgetName",
|
||||||
|
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||||
|
AyaObjectType = (int)AyaType.Widget,
|
||||||
|
SqlIdColumnName = "awidget.id",
|
||||||
|
SqlValueColumnName = "awidget.name"
|
||||||
|
});
|
||||||
|
l.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "username",
|
||||||
|
LtKey = "User",
|
||||||
|
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||||
|
AyaObjectType = (int)AyaType.User,
|
||||||
|
SqlIdColumnName = "auser.id",
|
||||||
|
SqlValueColumnName = "auser.name"
|
||||||
|
});
|
||||||
|
l.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
LtKey = "UserEmailAddress",
|
||||||
|
FieldKey = "emailaddress",
|
||||||
|
SqlValueColumnName = "auseroptions.emailaddress",
|
||||||
|
UiFieldDataType = (int)AyaUiFieldDataType.EmailAddress
|
||||||
|
});
|
||||||
|
l.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
LtKey = "Active",
|
||||||
|
FieldKey = "widgetactive",
|
||||||
|
SqlValueColumnName = "awidget.active",
|
||||||
|
UiFieldDataType = (int)AyaUiFieldDataType.Bool
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public AuthorizationRoles AllowedRoles => AuthorizationRoles.AllInternalStaff;//anyone but clients and subcontractors (just for test)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -53,7 +53,11 @@ namespace AyaNova.Biz
|
|||||||
///<summary>Anyone of any role</summary>
|
///<summary>Anyone of any role</summary>
|
||||||
All = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
|
All = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
|
||||||
InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
|
InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
|
||||||
SubContractorFull | ClientLimited | ClientFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited
|
SubContractorFull | ClientLimited | ClientFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited,
|
||||||
|
|
||||||
|
///<summary>Anyone inside company</summary>
|
||||||
|
AllInternalStaff = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
|
||||||
|
InventoryFull | AccountingFull | TechLimited | TechFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited
|
||||||
|
|
||||||
}//end AuthorizationRoles
|
}//end AuthorizationRoles
|
||||||
//, 65536, 131072, 262144, 524288, 1,048,576
|
//, 65536, 131072, 262144, 524288, 1,048,576
|
||||||
|
|||||||
Reference in New Issue
Block a user