☰
Current Page
Main Menu
Home
Home
Editing Applying-Security-to-Scheduled-Reports
Edit
Preview
H1
H2
H3
default
Set your preferred keybinding
default
vim
emacs
markdown
Set this page's format to
AsciiDoc
Creole
Markdown
MediaWiki
Org-mode
Plain Text
RDoc
Textile
Rendering unavailable for
BibTeX
Pod
reStructuredText
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
#Applying Tenant Level Security to Scheduled Reports [[_TOC_]] ##About This code sample shows how to apply security for the owner of the report when it gets sent out via the scheduler. This can allow reports to get disseminated based on the report owner's tenant ID and prevent any users outside of that group from receiving the report. ##C♯ Example ```csharp public override void PreExecuteReportSet(Izenda.AdHoc.ReportSet reportSet) { bool scheduler = AdHocSettings.CurrentUserName.Equals(AdHocSettings.DefaultUserName); //For the scheduler, the CurrentUserName will be the DefaultUserName as no user has logged in using the normal process. if (scheduler && reportSet.SendEmailAs != SchedulerOutput.SchedulerOutputType.Link.ToString()) //Do not need to perform this step if the report is sent as a link { AdHocSettings.TenantField = "TenantID"; //CurrentUserTenantId is already set from running run_scheduled_reports with tenants=tenant1,tenant2,etc... and TenantField uses CurrentUserTenantId as its value. Filter f = new Filter("Field_Derived_From_User"); f.Value = LookupDerivedTenantValue(reportSet.UserName); //Write your own implementation of this method. This will get the value for the field that should be derived from your user (the report owner) inside the tenant being run. reportSet.Filters.AddHidden(f); //add the temporary hidden filter. Normally this would be done during initialization. But since we didn't know the user's login information at initialization then we have to improvise. } } //end method ``` ##VB.NET Example ```visualbasic Public Overrides Sub PreExecuteReportSet(ByVal reportSet As Izenda.AdHoc.ReportSet) Dim scheduler As Boolean <> AdHocSettings.CurrentUserName.Equals(AdHocSettings.DefaultUserName) 'For the scheduler, the CurrentUserName will be the DefaultUserName as no user has logged in using the normal process. If scheduler AndAlso reportSet.SendEmailAs = SchedulerOutput.SchedulerOutputType.Link.ToString() Then 'Do not need to perform this step if the report is sent as a link AdHocSettings.TenantField = "TenantID" 'CurrentUserTenantId is already set from running run_scheduled_reports with tenants=tenant1,tenant2,etc... and TenantField uses CurrentUserTenantId as its value. Dim f As Filter = New Filter("Field_Derived_From_User") f.Value = LookupDerivedTenantValue(reportSet.UserName) 'Write your own implementation of this method. This will get the value for the field that should be derived from your user (the report owner) inside the tenant being run. reportSet.Filters.AddHidden(f) 'add the temporary hidden filter. Normally this would be done during initialization. But since we didn't know the user's login information at initialization then we have to improvise. End If End Sub 'end method ``` ##Limitations The Email Scheduler in the reporting system does not have a way to provide authentication (login & password) to your SMTP server. For the email scheduler to send messages to an SMTP server, you would need to provide an open path via the web server's IP address to the SMTP server that would not require authentication. ##Per-user Security On Scheduled Reports Scheduled reports only natively support per-user security using the Link format. Reports scheduled as attachments will not apply hidden filters normally unless using custom code as above based on the security of the report owner. This is because the reports cannot be run under the recipient's user context. There simply is not enough information to natively determine who is supposed to be running this report. If per-user security is required and writing custom code to handle attached reports is too messy, the Link format will require the user to login before seeing the report, thus applying security as normal.
Uploading file...
Header
 **This documentation is for the legacy Izenda 6 product. Documentation for the new Izenda 7 product can be found at [[https://www.izenda.com/docs/|https://www.izenda.com/docs/]]**
Sidebar
 --- * [[Izenda 7 Series Documentation|https://www.izenda.com/docs/]] * [[Release Notes]] * [[Upgrade Best Practices|FAQ/Izenda-Update-Best-Practices]] * [[FAQ]] * [[Tutorials]] * [[The Izenda API|/API/AdHocConfig]] * [[The AdHocSettings class|/API/AdHocSettings]] * [Developer Links and Guides](/Guides/Developer-Links-and-Guides) * [[Known Issues]] --- * <a href="http://www.izenda.com" rel="nofollow" target="_blank">Izenda Website</a> * [Product Video](https://www.youtube.com/watch?v=X3-yWFq0w5A) * <a href="http://www.izenda.com/blog" rel="nofollow" target="_blank">Izenda Blog</a> * <a href="http://www.izenda.com/company/" rel="nofollow" target="_blank">About Us</a> * <a href="http://www.izenda.com/contact-us/" rel="nofollow" target="_blank">Contact Us</a> --- * [Guide To Report Design](/Guides/ReportDesign) * [Making Custom Forms Video](http://www.youtube.com/watch?v=5b2axJlgdFs) --- * [[Acknowledgements]]
Edit message:
Cancel