public function testCanCurrentUserCanAccessModule()
 {
     $this->assertTrue(ReportSecurityUtil::canCurrentUserCanAccessModule('AccountsModule'));
     $this->assertTrue(ReportSecurityUtil::canCurrentUserCanAccessModule('ContactsModule'));
 }
Example #2
0
 /**
  * Returns true if the current user can render a report's results properly.  This method checks to see if the
  * user has full access to all the related modules and data that the report uses in construction.  This method
  * is needed because it is possible the author of a report added access for users that do not have complete
  * rights to the modules that are part of the report.  It is also possible this access changed over time and
  * a report that was once properly rendered is no longer.
  * @return bool
  */
 public function canCurrentUserProperlyRenderResults()
 {
     if (!ReportSecurityUtil::canCurrentUserCanAccessModule($this->moduleClassName)) {
         return false;
     }
     if (!ReportSecurityUtil::canCurrentUserAccessAllComponents($this->displayAttributes)) {
         return false;
     }
     if (!ReportSecurityUtil::canCurrentUserAccessAllComponents($this->filters)) {
         return false;
     }
     if (!ReportSecurityUtil::canCurrentUserAccessAllComponents($this->orderBys)) {
         return false;
     }
     if (!ReportSecurityUtil::canCurrentUserAccessAllComponents($this->groupBys)) {
         return false;
     }
     if (!ReportSecurityUtil::canCurrentUserAccessAllComponents($this->drillDownDisplayAttributes)) {
         return false;
     }
     return true;
 }