In order to use AzManPermissions, you have to connect to an AzMan authorization store (for more information: Authorization Manager). If your application can connect to it directly (for example, it's in a local XML file), then you need a connection string to the store and an application name within that store. Of course, you have to specify those to AzManPermissions. You can use the same connection string that you use to connect to the store in Authorization Manager MMC snap-in. The application name is the name of the application you created within the policy store. You can use the class AzManOperationPermission in your application to perform AzMan operation permission checks.

Specifying connection details through config
You can use your application's config file, to specify the authorization store connection details. In the appSettings section you can write the following settings:
    <add key="AzManConnectionString" value="azman connection string to the store"/>
    <add key="AzManApplicationName" value="azman application name in the store"/>

If you do not specify the AzManApplicationName in config, AzManPermissions tries to set it from the entry assembly's name, but in many applications it's not possible to determine it.

Specifying connection details from code
You can specify the authorization store's connection string and application name through the AzManPermissions.AzManOperationPermission.ConnectionString and AzManPermissions.AzManOperationPermission.ApplicationName or the AzManPermissions.AzManOperationHelper.ConnectionString and AzManPermissions.AzManOperationHelper.ApplicationName static properties.
  AzManPermissions.AzManOperationPermission.ConnectionString = "azman connection string to the store";
  AzManPermissions.AzManOperationPermission.ApplicationName = "azman application name in the store";

  AzManPermissions.AzManOperationHelper.ConnectionString = "azman connection string to the store";
  AzManPermissions.AzManOperationHelper.ApplicationName = "azman application name in the store";

Last edited Aug 23, 2012 at 12:59 PM by pjenei, version 3


No comments yet.