This commit is contained in:
2021-10-08 19:54:07 +00:00
parent 17f95daad8
commit 97e402c76c
2 changed files with 48 additions and 1 deletions

View File

@@ -256,4 +256,6 @@ America/Los_Angeles
Create a new db, run this once:
c:\data\code\postgres_14\bin\initdb -D ^"C^:^\data^\code^\postgres^_14^\ayanova^" -U postgres -A trust
that's it, run it with:
C:\data\code\postgres_14\bin\pg_ctl -D ^"C^:^\data^\code^\postgres^_14^\ayanova^" -l logfile start
C:\data\code\postgres_14\bin\pg_ctl -D ^"C^:^\data^\code^\postgres^_14^\ayanova^" -l logfile start
Note: for test win64 build just copy the empty db files generated above (before any access is done) into the C:\data\code\raven\dist\win-x64\data\database folder

View File

@@ -313,6 +313,51 @@ namespace AyaNova.DataList
}
#endregion build text ops criteria
break;
case UiFieldDataType.Roles:
{
/*
So Roles can be queried as contains or NOT contains with a bitwise &
also a Equals or NOt equals with a direct equality comparison
CONTAINS:
User selects roles, query checks if a user has all the roles the user selected with this query:
single OpsAdminRestricted (8192):
select name, roles from auser where (roles & 8192 = 8192) order by name
User has OpsAdminRestricted (8192) and SubContractorRestricted (512) which client will return as 8704:
select name, roles from auser where (roles & 8704 = 8704) order by name
brings up users with both opsadminrestricted and subconctractorrestricted and possibly others doesn't matter
EQUALITY:
just a simple = or <> i.e. where roles=4096 or roles!=4096
*/
switch (sOperator)
{
case DataListFilterComparisonOperator.Equality:
sb.Append($"= ${sValue} ");
break;
case DataListFilterComparisonOperator.NotEqual:
sb.Append($"<> ${sValue}");
break;
case DataListFilterComparisonOperator.Contains:
sb.Append($"& ${sValue}=${sValue} ");
break;
case DataListFilterComparisonOperator.NotContains:
sb.Append($"& ${sValue}!=${sValue} ");
break;
default:
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "DataListSqlFilterCriteriaBuilder unhandled operator type [" + sOperator + "] in ROLES");
}
}
break;
case UiFieldDataType.Bool:
{
switch (sOperator)