How to debugging Visual Guard ?

Estimated reading: 3 minutes 419 views

  • Why my user is rejected during the authentication process?
  • Is my permission is granted to the current user.
  • What is the value of my permission argument?
  • Why a security action is not executed?

Visual Guard: *******************************************************
Visual Guard: ==> 2006-08-23 13:27:22Z: Visual Guard initialization
Visual Guard: ==> 2006-08-23 13:27:23Z: Repository provider loaded: Novalys.VisualGuard.Security.Files.Repository.VGFileRepositoryConnection, Novalys.VisualGuard.Security.File, Version=2.5.708.6, Culture=neutral, PublicKeyToken=8e423a8f05ffd0dc
Visual Guard: Authorization attempt: user=jsmith (status=Success)
Visual Guard: Granted Role: #Sales manager (#Sales manager)
Visual Guard:     Granted permissions:
Visual Guard:         [Sales manager permissions].\Employees\Disable employees edition (id=8f95817d-ac24-4fd1-90d7-49a42eacd156)
Visual Guard:         [Sales manager permissions].\Products\Disable products and categories edition (id=bb241aa9-24ce-4b5b-96d3-4bf16db4e174)
Visual Guard:         [Common permissions].\Samples\Permission with argument(MyValue = My default value) (id=07b21eb4-4bef-4a0d-83aa-adb90c31a992)
Visual Guard:         [Common permissions].\Samples\Script Action Sample(Attribute1 = "My Value for attribute1", Attribute2 = 31/12/2006 00:00:00) (id=c755dfa1-73a3-47cd-8260-b4f6c20e3018)
Visual Guard:         [Non administrator permissions].\Users\Disable Membership edition (id=042e30c2-ca0f-4ce8-931f-8290fe98417e)
Visual Guard: Authentication attempt: user=jsmith (status=Success)
Visual Guard: ==> 2006-08-23 13:27:30Z: Set Security of Novalys.VisualGuard.NorthwindSample.Common.Data.SecuredNorthwindDataset
Visual Guard: ==> 2006-08-23 13:27:30Z: Set Security of Novalys.VisualGuard.NorthwindSample.MDIForm
Visual Guard: ==> 2006-08-23 13:27:30Z: Execute Action \Products\Disable products and categories edition.MDIForm.SetProperties(_myCategories.Enabled=False,_myProducts.En...)
Visual Guard: ==> 2006-08-23 13:27:30Z: Execute Action \Samples\Script Action Sample.MDIForm.SetProperties(_editConfigToolStripMenuItem.Visible=False)
Visual Guard: ==> 2006-08-23 13:27:30Z: == Action condition 'Enabled = true' is True => Action executed
Visual Guard: ==> 2006-08-23 13:27:30Z: Execute Action \Users\Disable Membership edition.MDIForm.SetProperties(_usersMenuItem.Enabled=False)


How to generate a trace in release mode

void VGModule_Initialized(object sender, Novalys.VisualGuard.Security.WebForm.VGSecurityInitializedEventArgs e)
{
    // Trace all information in a MyTrace.txt at the root of the website 
    string path = System.IO.Path.Combine(HttpRuntime.AppDomainAppPath, "MyTrace.Txt");

    System.Diagnostics.TextWriterTraceListener listener;

    listener = new System.Diagnostics.TextWriterTraceListener(new System.IO.FileStream(path, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite));

    Novalys.VisualGuard.Security.VGSecurityManager.TraceLevel = System.Diagnostics.TraceLevel.Info;
    Novalys.VisualGuard.Security.VGSecurityManager.TraceListener = listener;
}

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.diagnostics>
        <switches>
            <add name="VisualGuard" value="3" />
        </switches>              
        <trace autoflush="false" indentsize="4">
          <listeners>
            <add name="VisualGuard" type="System.Diagnostics.TextWriterTraceListener" initializeData="VGLog.txt" />
            <remove name="Default" />
          </listeners>
        </trace>
    </system.diagnostics>          
</configuration>


Debugging dynamic script action