This commit is contained in:
Thulio Bittencourt 2021-04-07 22:03:05 -03:00
parent 0fb40233d7
commit 04d38189fd
18 changed files with 1384 additions and 176 deletions

5
boss-lock.json Normal file
View File

@ -0,0 +1,5 @@
{
"hash": "d41d8cd98f00b204e9800998ecf8427e",
"updated": "2021-04-07T22:02:42.8886995-03:00",
"installedModules": {}
}

9
boss.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "safety4d",
"description": "",
"version": "1.0.0",
"homepage": "",
"mainsrc": "./",
"projects": [],
"dependencies": {}
}

View File

@ -0,0 +1,15 @@
program Safety4DSample;
uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
ReportMemoryLeaksOnShutdown := True;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,922 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{94E1E924-4B2D-49BF-9361-D6402259FADC}</ProjectGuid>
<ProjectVersion>19.2</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<MainSource>Safety4DSample.dpr</MainSource>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<SanitizedProjectName>Safety4DSample</SanitizedProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;CEF4Delphi;emsedge;fmx;FireDACIBDriver;fmxdae;vcledge;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;TBGWebCharts;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;CEF4Delphi;emsedge;fmx;FireDACIBDriver;fmxdae;vcledge;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_RemoteDebug>false</DCC_RemoteDebug>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
<DCC_UnitSearchPath>D:\Projetos\Componentes\RBAC4D\src;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Unit1.pas">
<Form>Form1</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>Application</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">Safety4DSample.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\CEF4Delphi_FMX.bpl">CEF4Delphi</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="Win32\Debug\Safety4DSample.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>Safety4DSample.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSInfoPList">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSLaunchScreen">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug">
<Platform Name="OSX64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

BIN
samples/Safety4DSample.res Normal file

Binary file not shown.

View File

@ -2,7 +2,7 @@ object Form1: TForm1
Left = 0 Left = 0
Top = 0 Top = 0
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 574 ClientHeight = 846
ClientWidth = 843 ClientWidth = 843
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
@ -13,12 +13,12 @@ object Form1: TForm1
OldCreateOrder = False OldCreateOrder = False
DesignSize = ( DesignSize = (
843 843
574) 846)
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
object GetResources: TButton object GetResources: TButton
Left = 8 Left = 401
Top = 49 Top = 353
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'GetResources' Caption = 'GetResources'
@ -26,20 +26,83 @@ object Form1: TForm1
OnClick = GetResourcesClick OnClick = GetResourcesClick
end end
object Memo1: TMemo object Memo1: TMemo
Left = 320 Left = 8
Top = 8 Top = 8
Width = 515 Width = 387
Height = 558 Height = 833
Anchors = [akLeft, akTop, akRight, akBottom] Anchors = [akLeft, akTop, akBottom]
Lines.Strings = ( Lines.Strings = (
'Memo1') '{'
' "resources": {'
' "safety4d": {'
' "users": {'
' "actions": {'
' "read": {'
' "description": "read-only",'
' "errormsg": "not permit"'
' },'
' "write": {'
' "description": "read-write",'
' "errormsg": "not write data"'
' },'
' "delete": {'
' "description": "delete-data",'
' "errormsg": "not delete data"'
' },'
' "view": {'
' "description": "view data",'
' "errormsg": "not view data"'
' }'
' }'
' }'
' }'
' },'
' "groupPermission": {'
' "{4D62E4C3-C73D-488A-8518-03A9545B5611}": {'
' "key": "Gerente",'
' "description": "Permissoes completa de gestao do Sis' +
'tema",'
' "Actions": ['
' "users.write"'
' ],'
' "NotActions": ['
' "*"'
' ]'
' },'
' "{C188D1AB-EC28-4380-96E0-D1B13A29A8B3}": {'
' "key": "Comercial",'
' "description": "Permissoes de Recursos Comerciais",'
' "Actions": ['
' "*"'
' ],'
' "NotActions": ['
' "users.delete",'
' "users.write"'
' ]'
' }'
' },'
' "userKeys": {'
' "{34C940ED-50E7-4CE3-B701-03CF1E15F28B}": {'
' "description": "Fulano de Tal",'
' "permissionGroups": ['
' "{4D62E4C3-C73D-488A-8518-03A9545B5611}"'
' ]'
' },'
' "{96B4C46F-0EBB-443B-B309-09C81844406E}": {'
' "description": "Beltrano",'
' "permissionGroups": ['
' "{C188D1AB-EC28-4380-96E0-D1B13A29A8B3}"'
' ]'
' }'
' }'
'}')
ScrollBars = ssVertical
TabOrder = 1 TabOrder = 1
ExplicitWidth = 451
ExplicitHeight = 438
end end
object Button1: TButton object Button1: TButton
Left = 8 Left = 401
Top = 90 Top = 394
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'CreateGroupPermission' Caption = 'CreateGroupPermission'
@ -47,8 +110,8 @@ object Form1: TForm1
OnClick = Button1Click OnClick = Button1Click
end end
object Button2: TButton object Button2: TButton
Left = 8 Left = 568
Top = 174 Top = 271
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'RegisterUserKeys' Caption = 'RegisterUserKeys'
@ -56,8 +119,8 @@ object Form1: TForm1
OnClick = Button2Click OnClick = Button2Click
end end
object Button3: TButton object Button3: TButton
Left = 8 Left = 568
Top = 231 Top = 312
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'GetSafety4DConfig' Caption = 'GetSafety4DConfig'
@ -65,8 +128,8 @@ object Form1: TForm1
OnClick = Button3Click OnClick = Button3Click
end end
object Button4: TButton object Button4: TButton
Left = 8 Left = 401
Top = 8 Top = 312
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'RegisterResource' Caption = 'RegisterResource'
@ -74,8 +137,8 @@ object Form1: TForm1
OnClick = Button4Click OnClick = Button4Click
end end
object Button5: TButton object Button5: TButton
Left = 8 Left = 568
Top = 295 Top = 353
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'SaveSafety4DConfig' Caption = 'SaveSafety4DConfig'
@ -83,8 +146,8 @@ object Form1: TForm1
OnClick = Button5Click OnClick = Button5Click
end end
object Button6: TButton object Button6: TButton
Left = 8 Left = 568
Top = 359 Top = 394
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'LoadSafety4DConfig' Caption = 'LoadSafety4DConfig'
@ -92,29 +155,82 @@ object Form1: TForm1
OnClick = Button6Click OnClick = Button6Click
end end
object Button7: TButton object Button7: TButton
Left = 8 Left = 401
Top = 131 Top = 435
Width = 161 Width = 161
Height = 35 Height = 35
Caption = 'GetGroupsPermissions' Caption = 'GetGroupsPermissions'
TabOrder = 8 TabOrder = 8
OnClick = Button7Click OnClick = Button7Click
end end
object Button8: TButton object GroupBox1: TGroupBox
Left = 48 Left = 401
Top = 464 Top = 8
Width = 121 Width = 434
Height = 25 Height = 257
Caption = 'Button8' Caption = 'Validar Permiss'#227'o'
TabOrder = 9 TabOrder = 9
OnClick = Button8Click object edtUserKey: TLabeledEdit
end Left = 16
object Edit1: TEdit Top = 40
Left = 48 Width = 401
Top = 437
Width = 121
Height = 21 Height = 21
TabOrder = 10 EditLabel.Width = 40
EditLabel.Height = 13
EditLabel.Caption = 'UserKey'
TabOrder = 0
Text = '{34C940ED-50E7-4CE3-B701-03CF1E15F28B}'
end
object edtApplication: TLabeledEdit
Left = 16
Top = 80
Width = 401
Height = 21
EditLabel.Width = 52
EditLabel.Height = 13
EditLabel.Caption = 'Application'
TabOrder = 1
Text = 'safety4d'
end
object edtResource: TLabeledEdit
Left = 16
Top = 120
Width = 401
Height = 21
EditLabel.Width = 45
EditLabel.Height = 13
EditLabel.Caption = 'Resource'
TabOrder = 2
Text = 'users'
end
object edtAction: TLabeledEdit
Left = 16
Top = 160
Width = 401
Height = 21
EditLabel.Width = 30
EditLabel.Height = 13
EditLabel.Caption = 'Action'
TabOrder = 3
Text = 'delete' Text = 'delete'
end end
object Button8: TButton
Left = 216
Top = 200
Width = 202
Height = 33
Caption = 'Validar Permiss'#227'o'
TabOrder = 4
OnClick = Button8Click
end
end
object Button9: TButton
Left = 401
Top = 271
Width = 161
Height = 35
Caption = 'RegisterApplication'
TabOrder = 10
OnClick = Button4Click
end
end end

View File

@ -12,7 +12,7 @@ uses
Vcl.Controls, Vcl.Controls,
Vcl.Forms, Vcl.Forms,
Vcl.Dialogs, Vcl.Dialogs,
Vcl.StdCtrls; Vcl.StdCtrls, Vcl.ExtCtrls;
type type
TForm1 = class(TForm) TForm1 = class(TForm)
@ -25,8 +25,13 @@ type
Button5: TButton; Button5: TButton;
Button6: TButton; Button6: TButton;
Button7: TButton; Button7: TButton;
GroupBox1: TGroupBox;
edtUserKey: TLabeledEdit;
edtApplication: TLabeledEdit;
edtResource: TLabeledEdit;
edtAction: TLabeledEdit;
Button8: TButton; Button8: TButton;
Edit1: TEdit; Button9: TButton;
procedure GetResourcesClick(Sender: TObject); procedure GetResourcesClick(Sender: TObject);
procedure Button1Click(Sender: TObject); procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject); procedure Button2Click(Sender: TObject);
@ -42,6 +47,8 @@ type
procedure _GetResources; procedure _GetResources;
procedure _GetGroupsPermissions; procedure _GetGroupsPermissions;
procedure _GetUserKeys; procedure _GetUserKeys;
procedure __ReloadConfig;
procedure __ReWriteMemoConfig;
public public
{ Public declarations } { Public declarations }
end; end;
@ -71,7 +78,7 @@ begin
.getGroups(aJsonSafety4D); .getGroups(aJsonSafety4D);
Memo1.Lines.Clear; Memo1.Lines.Clear;
Memo1.Lines.Add(TJson.Format(aJsonSafety4D)); Memo1.Lines.Add(aJsonSafety4D.Format);
finally finally
aJsonSafety4D.Free; aJsonSafety4D.Free;
end; end;
@ -90,7 +97,7 @@ begin
.getResource(aJsonSafety4D); .getResource(aJsonSafety4D);
Memo1.Lines.Clear; Memo1.Lines.Clear;
Memo1.Lines.Add(TJson.Format(aJsonSafety4D)); Memo1.Lines.Add(aJsonSafety4D.Format);
finally finally
aJsonSafety4D.Free; aJsonSafety4D.Free;
end; end;
@ -108,66 +115,44 @@ begin
.getUserKey(aJsonSafety4D); .getUserKey(aJsonSafety4D);
Memo1.Lines.Clear; Memo1.Lines.Clear;
Memo1.Lines.Add(TJson.Format(aJsonSafety4D)); Memo1.Lines.Add(aJsonSafety4D.Format);
finally finally
aJsonSafety4D.Free; aJsonSafety4D.Free;
end; end;
end; end;
procedure TForm1.__ReloadConfig;
var
aJson : TJsonObject;
begin
vSafety4D := nil;
aJson := TJSONObject.ParseJSONValue(Memo1.Lines.Text) as TJsonObject;
try
TSafety4D
.New
.LoadConfig(aJson);
finally
aJson.Free;
end;
end;
procedure TForm1.__ReWriteMemoConfig;
var
aJsonConfig : TJsonObject;
begin
Memo1.Lines.Clear;
aJsonConfig := TJsonObject.Create;
try
TSafety4D.New.getConfig(aJsonConfig);
Memo1.Lines.Add(aJsonConfig.Format);
finally
aJsonConfig.Free;
end;
end;
procedure TForm1.GetResourcesClick(Sender: TObject); procedure TForm1.GetResourcesClick(Sender: TObject);
begin begin
_GetResources; _GetResources;
{*
TRbac4D
.New
//Como registrar os recursos
//Default Resource [view, read, write, delete, action]
//<sGroup, TDictionary<sProviderName, TDictionary<sActions, string>>>;
//Buscar grupo de permissões
TRbac4D
.New
.getFunctionDefinitions; //TArray<TFunctionDefinition>
//Busar Resources
TRbac4D
.New
.getResourcesGroup('GroupName'); //TArray<TResourcesGroupName>
//Como validar o acesso a um recurso
TRbac4D
.New
.validateAccess
.roleName('operador')
.group('housex')
.provider('user')
.resource('Actions.getSaldo')
.Execute; //Boolean
//Atribuir as Roles na instancia global
TRbac4D
.New
.roleName('operador|marketing|gerente');
TRbac4D
.New
.loadConfiguration(aJsonString);
TRbac4D
.New
.saveConfiguration; //Retorna JsonString;
*}
end; end;
procedure TForm1.Button1Click(Sender: TObject); procedure TForm1.Button1Click(Sender: TObject);
@ -228,7 +213,7 @@ begin
TSafety4D.New.getConfig(aJsonSafety4D); TSafety4D.New.getConfig(aJsonSafety4D);
Memo1.Lines.Clear; Memo1.Lines.Clear;
Memo1.Lines.Add(TJson.Format(aJsonSafety4D)); Memo1.Lines.Add(aJsonSafety4D.Format);
finally finally
aJsonSafety4D.Free; aJsonSafety4D.Free;
end; end;
@ -237,7 +222,35 @@ end;
procedure TForm1.Button4Click(Sender: TObject); procedure TForm1.Button4Click(Sender: TObject);
begin begin
RegisterResources; TSafety4D
.New
.resources
.registerResources
.resourcesGroupName
.add('newapplication')
.providerName
.add('users')
.actions
.add('read')
.description('read-only')
.errormsg('not permit')
.&end
.add('write')
.description('read-write')
.errormsg('not write data')
.&end
.add('delete')
.description('delete-data')
.errormsg('not delete data')
.&end
.add('view')
.description('view data')
.errormsg('not view data')
.&end
.&end
.&end;
__ReWriteMemoConfig;
end; end;
procedure TForm1.Button5Click(Sender: TObject); procedure TForm1.Button5Click(Sender: TObject);
@ -266,13 +279,17 @@ end;
procedure TForm1.Button8Click(Sender: TObject); procedure TForm1.Button8Click(Sender: TObject);
begin begin
__ReloadConfig;
try try
TSafety4D.New TSafety4D.New
.configurations
.exceptions(True)
.&end
.Validation .Validation
.userKey('{34C940ED-50E7-4CE3-B701-03CF1E15F28B}') .userKey(edtUserKey.Text)
.application('delphitohero') .application(edtApplication.Text)
.resource('users') .resource(edtResource.Text)
.action(edit1.Text) .action(edtAction.Text)
.validate; .validate;
ShowMessage('Usuario Autorizado'); ShowMessage('Usuario Autorizado');
except on e : Exception do except on e : Exception do
@ -282,36 +299,7 @@ end;
procedure TForm1.RegisterResources; procedure TForm1.RegisterResources;
begin begin
TSafety4D
.New
.resources
.registerResources
.resourcesGroupName
.add('delphitohero')
.providerName
.add('users')
.actions
.add('read')
.description('read-only')
.errormsg('not permit')
.&end
.add('write')
.description('read-write')
.errormsg('not write data')
.&end
.add('delete')
.description('delete-data')
.errormsg('not delete data')
.&end
.add('view')
.description('view data')
.errormsg('not view data')
.&end
.&end
.&end
.&end
.&end
.&end;
end; end;
end. end.

View File

@ -0,0 +1,63 @@
{
"resources": {
"delphitohero": {
"users": {
"actions": {
"read": {
"description": "read-only",
"errormsg": "not permit"
},
"write": {
"description": "read-write",
"errormsg": "not write data"
},
"delete": {
"description": "delete-data",
"errormsg": "not delete data"
},
"view": {
"description": "view data",
"errormsg": "not view data"
}
}
}
}
},
"groupPermission": {
"{4D62E4C3-C73D-488A-8518-03A9545B5611}": {
"key": "Gerente",
"description": "Permiss<73>es completa de gest<73>o do Sistema",
"Actions": [
"users.write"
],
"NotActions": [
"*"
]
},
"{C188D1AB-EC28-4380-96E0-D1B13A29A8B3}": {
"key": "Comercial",
"description": "Permiss<73>es de Recursos Comerciais",
"Actions": [
"*"
],
"NotActions": [
"users.delete",
"users.write"
]
}
},
"userKeys": {
"{34C940ED-50E7-4CE3-B701-03CF1E15F28B}": {
"description": "Fulano de Tal",
"permissionGroups": [
"{4D62E4C3-C73D-488A-8518-03A9545B5611}"
]
},
"{96B4C46F-0EBB-443B-B309-09C81844406E}": {
"description": "Beltrano",
"permissionGroups": [
"{C188D1AB-EC28-4380-96E0-D1B13A29A8B3}"
]
}
}
}

View File

@ -0,0 +1,61 @@
unit Safety4D.Configuration;
interface
uses
Safety4D.Interfaces;
type
TSafety4DConfiguration = class(TInterfacedObject, iSafety4DConfiguration)
private
[weak]
FParent : iSafety4D;
FException : Boolean;
public
constructor Create(aParent : iSafety4D);
destructor Destroy; override;
class function New(aParent : iSafety4D) : iSafety4DConfiguration;
function exceptions( aValue : Boolean ) : iSafety4DConfiguration; overload;
function exceptions : boolean; overload;
function &End : iSafety4D;
end;
implementation
{ TSafety4DConfiguration }
function TSafety4DConfiguration.&end : iSafety4D;
begin
Result := FParent;
end;
function TSafety4DConfiguration.exceptions: boolean;
begin
Result := FException;
end;
function TSafety4DConfiguration.exceptions(
aValue: Boolean): iSafety4DConfiguration;
begin
Result := Self;
FException := aValue;
end;
constructor TSafety4DConfiguration.Create(aParent : iSafety4D);
begin
FParent := aParent;
FException := False;
end;
destructor TSafety4DConfiguration.Destroy;
begin
inherited;
end;
class function TSafety4DConfiguration.New(aParent : iSafety4D): iSafety4DConfiguration;
begin
Result := Self.Create(aParent);
end;
end.

View File

@ -43,11 +43,10 @@ function TSafety4DGroups.getGroups(
var aJson: TJsonObject): iSafety4DGroup; var aJson: TJsonObject): iSafety4DGroup;
var var
aJsonActions : TJsonArray; aJsonActions : TJsonArray;
aJsonGroups : TJsonObject;
aJsonGroup : TJsonObject; aJsonGroup : TJsonObject;
begin begin
Result := Self; Result := Self;
for var group in FgroupRegister.getGroupsRegisters do for var group in groupRegister.getGroupsRegisters do
begin begin
aJson.AddPair(group.Key, TJsonObject.Create); aJson.AddPair(group.Key, TJsonObject.Create);
aJsonGroup := aJson.GetValue<TJsonObject>(group.Key); aJsonGroup := aJson.GetValue<TJsonObject>(group.Key);

View File

@ -16,6 +16,7 @@ type
iSafety4DGroup = interface; iSafety4DGroup = interface;
iSafety4DUserKey = interface; iSafety4DUserKey = interface;
iSafety4DValidation = interface; iSafety4DValidation = interface;
iSafety4DConfiguration = interface;
iSafety4D = interface iSafety4D = interface
@ -23,12 +24,20 @@ type
function Validation : iSafety4DValidation; function Validation : iSafety4DValidation;
function resources : iSafety4DResources; function resources : iSafety4DResources;
function groupPermission : iSafety4DGroup; function groupPermission : iSafety4DGroup;
function configurations : iSafety4DConfiguration;
function userKey : iSafety4DUserKey; function userKey : iSafety4DUserKey;
function getConfig (var aJson : TJsonObject ) : iSafety4D; function getConfig (var aJson : TJsonObject ) : iSafety4D;
function SaveToStorage ( aPath : String = '' ) : iSafety4D; function SaveToStorage ( aPath : String = '' ) : iSafety4D;
function LoadConfig ( aJson : TJsonObject ) : iSafety4D; function LoadConfig ( aJson : TJsonObject ) : iSafety4D;
end; end;
iSafety4DConfiguration = interface
['{E5561A2B-42D5-4A53-9EE6-57C1882C610D}']
function exceptions( aValue : Boolean ) : iSafety4DConfiguration; overload;
function exceptions : boolean; overload;
function &end : iSafety4D;
end;
iSafety4DValidation = interface iSafety4DValidation = interface
['{3EB75190-778C-4E0B-ABE7-A17A78103C5B}'] ['{3EB75190-778C-4E0B-ABE7-A17A78103C5B}']
function userKey( aValue : String ) : iSafety4DValidation; overload; function userKey( aValue : String ) : iSafety4DValidation; overload;

View File

@ -12,7 +12,6 @@ type
[weak] [weak]
FParent : iSafety4DResourcesGroupProvider; FParent : iSafety4DResourcesGroupProvider;
FActionList : TDictionary<string, iSafety4DResourcesGroupProviderActionsMsg>; FActionList : TDictionary<string, iSafety4DResourcesGroupProviderActionsMsg>;
FActionsMsg : iSafety4DResourcesGroupProviderActionsMsg;
public public
constructor Create(aParent : iSafety4DResourcesGroupProvider); constructor Create(aParent : iSafety4DResourcesGroupProvider);
destructor Destroy; override; destructor Destroy; override;

View File

@ -50,13 +50,6 @@ begin
Result := Self; Result := Self;
FProviderName := aValue; FProviderName := aValue;
FProviderNameList.Add(aValue, TSafety4DResourcesGroupProviderActions.New(Self)); FProviderNameList.Add(aValue, TSafety4DResourcesGroupProviderActions.New(Self));
// FProviderNameList
// .Items[aValue]
// .add('*')
// .add('read')
// .add('write')
// .add('delete')
// .add('view');
end; end;
constructor TSafety4DResourcesGroupProvider.Create(aParent : iSafety4DResourcesGroup); constructor TSafety4DResourcesGroupProvider.Create(aParent : iSafety4DResourcesGroup);

View File

@ -35,7 +35,7 @@ end;
function TSafety4DResourcesRegister.getResourceGroups: TDictionary<string, iSafety4DResourcesGroupProvider>; function TSafety4DResourcesRegister.getResourceGroups: TDictionary<string, iSafety4DResourcesGroupProvider>;
begin begin
Result := FResourceGroupName.getResourcesGroupList; Result := resourcesGroupName.getResourcesGroupList;
end; end;
constructor TSafety4DResourcesRegister.Create(aParent : iSafety4DResources); constructor TSafety4DResourcesRegister.Create(aParent : iSafety4DResources);

View File

@ -40,31 +40,43 @@ var
iResourceActions : iSafety4DResourcesGroupProviderActions; iResourceActions : iSafety4DResourcesGroupProviderActions;
iActionMessage : iSafety4DResourcesGroupProviderActionsMsg; iActionMessage : iSafety4DResourcesGroupProviderActionsMsg;
begin begin
Result := False; Result := True;
if not FRegisterResources.getResourceGroups.TryGetValue(aApplication, iResource) then if not registerResources.getResourceGroups.TryGetValue(aApplication, iResource) then
begin
Result := False;
if FParent.configurations.exceptions then
raise Exception.Create('Unregistered Application'); raise Exception.Create('Unregistered Application');
exit;
end;
if not iResource.getProviderNames.TryGetValue(aResource, iResourceActions) then if not iResource.getProviderNames.TryGetValue(aResource, iResourceActions) then
begin
Result := False;
if FParent.configurations.exceptions then
raise Exception.Create('Unregistered resource'); raise Exception.Create('Unregistered resource');
exit;
end;
if not iResourceActions.getActions.TryGetValue(aAction, iActionMessage) then if not iResourceActions.getActions.TryGetValue(aAction, iActionMessage) then
begin
Result := False;
if FParent.configurations.exceptions then
raise Exception.Create('unregistered action'); raise Exception.Create('unregistered action');
exit;
end;
end; end;
function TSafety4DResources.getResource( function TSafety4DResources.getResource(
var aJson: TJsonObject): iSafety4DResources; var aJson: TJsonObject): iSafety4DResources;
var var
aJsonResources : TJsonObject;
aJsonGroup : TJsonObject; aJsonGroup : TJsonObject;
aJsonProvider : TJsonObject; aJsonProvider : TJsonObject;
aJsonActions : TJsonObject; aJsonActions : TJsonObject;
begin begin
Result := Self; Result := Self;
//aJson.AddPair('resources', TJSONArray.Create.Add(TJSONObject.Create)); for var Resource in registerResources.getResourceGroups do
for var Resource in FRegisterResources.getResourceGroups do
begin begin
//aJsonResources := (aJson.GetValue<TJsonArray>('resources').Items[0] as TJsonObject);
aJson.AddPair(Resource.Key, TJSONObject.Create); aJson.AddPair(Resource.Key, TJSONObject.Create);
for var Provider in Resource.Value.getProviderNames do for var Provider in Resource.Value.getProviderNames do
begin begin

View File

@ -38,16 +38,21 @@ function TSafety4DUserKey.exists(aUserKey: String): Boolean;
var var
iUser : iSafety4DUserKeyRegisterGroupPermission; iUser : iSafety4DUserKeyRegisterGroupPermission;
begin begin
Result := True;
if not FRegisterUserKey.GetUserKeyRegister.TryGetValue(aUserKey, iUser) then if not FRegisterUserKey.GetUserKeyRegister.TryGetValue(aUserKey, iUser) then
begin
Result := False;
if FParent.configurations.exceptions then
raise Exception.Create('User key not registered'); raise Exception.Create('User key not registered');
end; end;
end;
function TSafety4DUserKey.getUserKey(var aJson: TJsonObject): iSafety4DUserKey; function TSafety4DUserKey.getUserKey(var aJson: TJsonObject): iSafety4DUserKey;
var var
aJsonRegister : TJsonObject; aJsonRegister : TJsonObject;
aJsonPermission : TJsonArray; aJsonPermission : TJsonArray;
begin begin
for var userRegister in FRegisterUserKey.GetUserKeyRegister do for var userRegister in registerUserKey.GetUserKeyRegister do
begin begin
aJson.AddPair(userRegister.Key, TJsonObject.Create); aJson.AddPair(userRegister.Key, TJsonObject.Create);
aJsonRegister := aJson.GetValue<TJsonObject>(userRegister.Key); aJsonRegister := aJson.GetValue<TJsonObject>(userRegister.Key);

View File

@ -104,7 +104,6 @@ end;
function TSafety4DValidation.validate: boolean; function TSafety4DValidation.validate: boolean;
var var
aTeste : String;
FAllAcess : Boolean; FAllAcess : Boolean;
FAllBlock : Boolean; FAllBlock : Boolean;
iGroupPermission : iSafety4DGroupListActions; iGroupPermission : iSafety4DGroupListActions;
@ -118,7 +117,6 @@ begin
for var UserPermission in FParent.userKey.getUserKeyPermissions(FuserKey) do for var UserPermission in FParent.userKey.getUserKeyPermissions(FuserKey) do
begin begin
aTeste := UserPermission;
iGroupPermission := FParent.groupPermission.getGroupPermission(UserPermission); iGroupPermission := FParent.groupPermission.getGroupPermission(UserPermission);
for var aAction in iGroupPermission.actions.getActions do for var aAction in iGroupPermission.actions.getActions do
@ -136,6 +134,7 @@ begin
for var aNotAction in iGroupPermission.notActions.getNotActions do for var aNotAction in iGroupPermission.notActions.getNotActions do
begin begin
if UpperCase(aNotAction) = UpperCase(FResource+'.'+FAction) then if UpperCase(aNotAction) = UpperCase(FResource+'.'+FAction) then
if FParent.configurations.exceptions then
raise Exception.Create('Access not allowed to these resources'); raise Exception.Create('Access not allowed to these resources');
if aNotAction = '*' then if aNotAction = '*' then
@ -144,6 +143,7 @@ begin
if not Result and FAllAcess then Result := FAllAcess; if not Result and FAllAcess then Result := FAllAcess;
if not Result and FAllBlock then if not Result and FAllBlock then
if FParent.configurations.exceptions then
raise Exception.Create('Access not allowed to these resources'); raise Exception.Create('Access not allowed to these resources');
end; end;
except on e : Exception do except on e : Exception do

View File

@ -3,7 +3,9 @@ unit Safety4D;
interface interface
uses uses
Safety4D.Interfaces, System.JSON; Safety4D.Interfaces,
System.JSON,
System.Generics.Collections;
type type
TSafety4D = class(TInterfacedObject, iSafety4D) TSafety4D = class(TInterfacedObject, iSafety4D)
@ -12,6 +14,7 @@ type
FGroupPermission : iSafety4DGroup; FGroupPermission : iSafety4DGroup;
FuserKey : iSafety4DUserKey; FuserKey : iSafety4DUserKey;
FValidation : iSafety4DValidation; FValidation : iSafety4DValidation;
FConfigurations : iSafety4DConfiguration;
procedure __loadResourcesJson(var aJson : TJsonObject); procedure __loadResourcesJson(var aJson : TJsonObject);
procedure __loadGroupPermissionJson(var aJson : TJsonObject); procedure __loadGroupPermissionJson(var aJson : TJsonObject);
procedure __loadUserKeysJson(var aJson : TJsonObject); procedure __loadUserKeysJson(var aJson : TJsonObject);
@ -22,6 +25,7 @@ type
function Validation : iSafety4DValidation; function Validation : iSafety4DValidation;
function resources : iSafety4DResources; function resources : iSafety4DResources;
function groupPermission : iSafety4DGroup; function groupPermission : iSafety4DGroup;
function configurations : iSafety4DConfiguration;
function userKey : iSafety4DUserKey; function userKey : iSafety4DUserKey;
function getConfig (var aJson : TJsonObject ) : iSafety4D; function getConfig (var aJson : TJsonObject ) : iSafety4D;
function SaveToStorage ( aPath : String = '' ) : iSafety4D; function SaveToStorage ( aPath : String = '' ) : iSafety4D;
@ -40,10 +44,18 @@ uses
Safety4D.UserKey, Safety4D.UserKey,
System.SysUtils, System.SysUtils,
System.Classes, System.Classes,
Rest.Json, Safety4D.Validation; Rest.Json, Safety4D.Validation, Safety4D.Configuration;
{ TSafety4D } { TSafety4D }
function TSafety4D.configurations: iSafety4DConfiguration;
begin
if not Assigned(FConfigurations) then
FConfigurations := TSafety4DConfiguration.New(Self);
Result := FConfigurations;
end;
constructor TSafety4D.Create; constructor TSafety4D.Create;
begin begin
@ -67,9 +79,9 @@ begin
aResource := aJson.GetValue<TJsonObject>('resources'); aResource := aJson.GetValue<TJsonObject>('resources');
aGroup := aJson.GetValue<TJsonObject>('groupPermission'); aGroup := aJson.GetValue<TJsonObject>('groupPermission');
aUser := aJson.GetValue<TJsonObject>('userKeys'); aUser := aJson.GetValue<TJsonObject>('userKeys');
FResources.getResource(aResource); resources.getResource(aResource);
FGroupPermission.getGroups(aGroup); groupPermission.getGroups(aGroup);
FuserKey.getUserKey(aUser); userKey.getUserKey(aUser);
end; end;
function TSafety4D.groupPermission: iSafety4DGroup; function TSafety4D.groupPermission: iSafety4DGroup;
@ -125,7 +137,7 @@ begin
StrList := TStringList.Create; StrList := TStringList.Create;
try try
Self.getConfig(aJsonResult); Self.getConfig(aJsonResult);
StrList.Add(TJson.Format(aJsonResult)); StrList.Add(aJsonResult.Format);
StrList.SaveToFile(aPath); StrList.SaveToFile(aPath);
finally finally
StrList.DisposeOf; StrList.DisposeOf;
@ -162,8 +174,8 @@ var
begin begin
for I := 0 to Pred(aJson.Count) do for I := 0 to Pred(aJson.Count) do
begin begin
FGroupName := aJson.Get(I).JsonString.Value; FGroupName := aJson.Pairs[I].JsonString.Value;
aJsonGroup := aJson.Get(I).JsonValue as TJsonObject; aJsonGroup := aJson.Pairs[I].JsonValue as TJsonObject;
aJsonActions := aJsonGroup.GetValue<TJsonArray>('Actions'); aJsonActions := aJsonGroup.GetValue<TJsonArray>('Actions');
aJsonNotActions := aJsonGroup.GetValue<TJsonArray>('NotActions'); aJsonNotActions := aJsonGroup.GetValue<TJsonArray>('NotActions');
@ -177,14 +189,14 @@ begin
for X := 0 to Pred(aJsonActions.Count) do for X := 0 to Pred(aJsonActions.Count) do
begin begin
iAction.add(aJsonActions.Get(X).Value); iAction.add(aJsonActions.Items[X].Value);
end; end;
iNotAction := iAction.&end.notActions; iNotAction := iAction.&end.notActions;
for X := 0 to Pred(aJsonNotActions.Count) do for X := 0 to Pred(aJsonNotActions.Count) do
begin begin
iNotAction.add(aJsonNotActions.Get(X).Value); iNotAction.add(aJsonNotActions.Items[X].Value);
end; end;
end; end;
end; end;
@ -203,12 +215,12 @@ var
begin begin
for I := 0 to Pred(aJson.Count) do for I := 0 to Pred(aJson.Count) do
begin begin
FGroupName := aJson.Get(I).JsonString.Value; FGroupName := aJson.Pairs[I].JsonString.Value;
aJsonGroup := aJson.Get(I).JsonValue as TJSONObject; aJsonGroup := aJson.Pairs[I].JsonValue as TJSONObject;
for J := 0 to Pred(aJsonGroup.Count) do for J := 0 to Pred(aJsonGroup.Count) do
begin begin
FProviderName := aJsonGroup.Get(J).JsonString.Value; FProviderName := aJsonGroup.Pairs[J].JsonString.Value;
aJsonProvider := aJsonGroup.Get(I).JsonValue as TJSONObject; aJsonProvider := aJsonGroup.Pairs[I].JsonValue as TJSONObject;
aJsonActions := aJsonProvider.GetValue<TJsonObject>('actions'); aJsonActions := aJsonProvider.GetValue<TJsonObject>('actions');
iProviderAction := iProviderAction :=
@ -223,9 +235,9 @@ begin
for K := 0 to Pred(aJsonActions.Count) do for K := 0 to Pred(aJsonActions.Count) do
begin begin
iProviderAction iProviderAction
.add(aJsonActions.Get(K).JsonString.Value) .add(aJsonActions.Pairs[K].JsonString.Value)
.description(aJsonActions.Get(K).JsonValue.GetValue<String>('description')) .description(aJsonActions.Pairs[K].JsonValue.GetValue<String>('description'))
.errormsg(aJsonActions.Get(K).JsonValue.GetValue<String>('errormsg')) .errormsg(aJsonActions.Pairs[K].JsonValue.GetValue<String>('errormsg'))
end; end;
end; end;
end; end;
@ -242,8 +254,8 @@ var
begin begin
for I := 0 to Pred(aJson.Count) do for I := 0 to Pred(aJson.Count) do
begin begin
FGroupName := aJson.Get(I).JsonString.Value; FGroupName := aJson.Pairs[I].JsonString.Value;
aJsonGroup := aJson.Get(I).JsonValue as TJsonObject; aJsonGroup := aJson.Pairs[I].JsonValue as TJsonObject;
aJsonPermission := aJsonGroup.GetValue<TJsonArray>('permissionGroups'); aJsonPermission := aJsonGroup.GetValue<TJsonArray>('permissionGroups');
iPermissionGroup := iPermissionGroup :=
@ -254,7 +266,7 @@ begin
for X := 0 to Pred(aJsonPermission.Count) do for X := 0 to Pred(aJsonPermission.Count) do
begin begin
iPermissionGroup.addPermission(aJsonPermission.Get(X).Value); iPermissionGroup.addPermission(aJsonPermission.Items[X].Value);
end; end;
end; end;
end; end;