security_check_session_saved_group_key
security_check_session_saved_group_key
security_check_session_saved_group_key(string $session_group_key, array $allowed_group_array)
Parameter | Description |
---|---|
$session_group_key | A session key in your project that references the active user group or group id. You want the engine to check for the existence of this key in the session before allowing any access to your private report. |
$allowed_group_array | an array of names or IDs of the groups that are allowed to access your report. For example array(3, 5) or array("sales","admins") |
$report = new ReportOptions(SRE_PRIVATE_REPORT);
$report->select_tables(array("items"))
->select_all_fields()
->security_init("some_login_page_url","some_logout_page_url","project1")
->security_check_session_saved_user_key("user_id")
->security_check_session_saved_group_key("group", array("sales", "admins"));
$engine = new CustomEngine($report);
$report_path = $engine->create_report();
if ($report_path) {
echo "Your report URL:" . $report_path;
}