Constable Authorization Engine 2.0 BETA

Sample Applications

[This is preliminary documentation and subject to change.]

PolicyInDatabase Sample

Please follow these steps to set up the sample:

1. Copy the PolicyDesign.zip file to the CAZE Samples directory (<CAZE Installation Directory>\Samples) and extract the files with folder names. This should create the following directory on your hard drive: <CAZE Installation Directory>\Samples\PolicyDesign\2005\PolicyInDatabase. For simplicity, I'll call this directory PolicyInDatabase directory from now on.

2. Use the SQL Server Query Analyzer tool (or the osql.exe command line tool) to execute the T-SQL script PolicyInDatabase\Scripts\PolicyDatabaseSetup.sql. The script creates a table and a couple of views and stored procedures for storing and loading authorization policies to / from the database (all the created database objects have names with the lamarvin_pdb_ prefix - see the T-SQL script for more information).

3. Open the PolicyInDatabase\VB\PolicyInDatabaseVB\PolicyInDatabaseVB.sln solution in Visual Studio 2005 (please note that currently there is only Visual Studio 2005 version of the sample available). Open the PolicyInDatabaseVB project properties, select the Debug tab and specify a correct path to the caze.exe executable to be started as an external program when debugging. The caze.exe file is located in the <CAZE Installation Directory>\bin folder. The solution has post-build commands that will copy the PolicyInDatabaseVB sample outputs to the caze.exe directory so that it will load the sample Policy Design extension allowing you to debug it in the caze.exe process.

4. Create a new caze.exe.config file in the <CAZE Installation Directory>\bin and specify the required .NET Framework version to be 2.0 (otherwise caze.exe won't load your extension) and a connection string to the database you've setup in the second step above. The configuration file should look like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <appSettings>
    <add key="CazePolicyDatabaseConnectionString" value="server=localhost;database=cazedb;trusted_connection=true;" />
  </appSettings>
  
  <startup>
    <supportedRuntime version="v2.0.50727" />
  </startup>
  
</configuration>
Now when you run the solution, the caze.exe process should be launched with the PolicyInDatabaseVB extension loaded. You can place a breakpoint in the SqlServerPersistencePolicyDesignExtension.Initialize method, which is called as first by the Policy Designer and see how the extension installs and handles the custom commands.

Please note this is a pre-release code, so there is very little documentation and it is not yet fully debugged and tested.