ActiveReports 10 Server User Guide
Security Provider Sample
ActiveReports 10 Server User Guide > Samples and Walkthroughs > Samples > Security Provider Sample

The ActiveReports Server installation includes a security provider sample that you can find in:

C:\ActiveReports 10 Server\SDK\Samples\ActiveTunes.SecurityProvider

To open the solution, double-click the ActiveTunes.SecurityProvider.sln file.

Sample Project Description
ActiveTunes.SecurityProvider Shows how you can provide proprietary or single-sign-on authentication instead of the built-in ActiveReports Server security and use row-level security.
ActiveTunes.SecurityProvider.UnitTests Shows how you can test the row-level security using sample data.

To compile and use the Security Provider sample

  1. With the sample open in Visual Studio, from the Build menu, select Build Solution.
  2. In Windows Explorer, open the following folder, and copy the ActiveTunes.SecurityProvider.dll assembly.
    C:\ActiveReports 10 Server\SDK\Samples\ActiveTunes.SecurityProvider\ActiveTunes.SecurityProvider\bin\Debug
  3. Paste the assembly into the following folder in your ActiveReports 10 Server installation folder.
    C:\ActiveReports 10 Server\SecurityProviders
  4. On the Administrator Dashboard, in the Configuration section, click Security Provider.
  5. From the Custom security provider drop-down that appears, select ActiveTunesSecurityProviderFactory.
  6. In the ConnectionString property that appears, enter the connection string found in the ActiveTunes.SecurityProvider.UnitTests project file App.config:
     
    ConnectionString
    Copy Code
    Data Source=C:\ActiveReports 10 Server\SDK\Samples\ActiveTunes.SecurityProvider\ActiveTunes.sqlite
    
  7. Click the Apply changes button.

Now, when you edit the ActiveTunes sample model, you can apply either the EmployeeID or CustomerID filter to any entity.

To add row-level security to the ActiveTunes sample model

  1. On the Administrator Dashboard, in the Administration section, click Models.
  2. In the list of models that appears, next to the ActiveTunes (Sample) model, click the Edit command.
  3. In the model editor that appears, from the Entities list to the left, click the entity that you want to filter.
  4. In the workspace at the center, next to the Security Filter property, click the Add command.
  5. In the Edit Security Filter dialog that appears, in the box next to Filter Name, enter a name for your filter.
  6. Select Filter Expression, and click the ellipsis button next to the box under that label.
  7. In the Select Attribute dialog that appears, select the attribute to which you want to apply the filter condition, and click OK.
  8. To the right of the equals option, click the drop-down arrow and select UserContext.CustomerID or UserContext.EmployeeID.
  9. Click Apply to add the filter to the entity.
See Also

SDK Tutorials