# Grant report rights

> Give roles the eight Analytics and Reports rights (reports_view, reports_design, datasets_edit, reports_schedule, reports_distribute_external, reports_sign, analytics, reports_admin) with feature rules - the defaults of a new installation, what to grant after an upgrade (only the Administrator holds them until then), DENY rules, the AI co-pilot's ceiling, API tokens and remote access.

Product: eaxScada · Type: How-to guide · Editions: Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/grant-report-rights/
Verified against commit 4e830ea.

## Goal

Decide who may run reports, who may design them and who may write the queries behind them. These rights are about using the module. **What a report shows** is decided separately, by each user's tag read rights: a user who may run a report still sees only the tags they may read ([A report shows only what you may read](/docs/eaxscada/explanation/analytics-and-reports/#a-report-shows-only-what-you-may-read)).

**Diagram: What a report dataset can read** (layered stack)

A dataset's SQL sits on top of three layers the server builds below it. The stored history and alarms are cut to the tags the user may read inside the dataset's tag scope, then to the run's time window, and offered as the only relations the SQL may name. A query that names anything else is refused; the rest runs as one SELECT in a transaction that is always rolled back.

**Parts**

- **The query** (layer 1): One SELECT, in a transaction that is always rolled back.
- **The relations** (layer 2): Built by the server below the query.
- **Readable tags** (layer 3): The tag scope and the user's read rights.
- **Stored history** (layer 4): Read by the server, never named by the SQL.
- **SQL guard** (check or decision): names only samples, alarm_events, alarm_definitions
- **Secured relations** (service or process): inside the time window (definitions: no window); alarms: routing rule
- **Allowed tags** (check or decision): tag scope and read rights; hidden tags counted, never named
- **History and alarms** (data store): columnar store, older CSV rows, alarm journal and definitions
- **Refused** (outcome): stored tables, files, table functions, a hidden tag
- **Report output** (service or process): preview, PDF, workbook

**Connections**

- **History and alarms → Allowed tags** (data or telemetry). The stored history is read for the allowed tags only: the columnar store, and for each tag the CSV rows older than its first point in the columnar store.
- **Allowed tags → Secured relations** (data or telemetry). The allowed tags are the tags of the current tag list inside the dataset's tag scope that the user may read. Tags the scope covers but the user may not read are counted on the report, never named. An empty tag scope is refused.
- **Secured relations → SQL guard** (data or telemetry). samples and alarm_events hold only rows of the run's time window; alarm_definitions has no window. Alarm rows also follow the routing rule of the live alarm views.
- **SQL guard → Refused** (refusal). A query that names a stored table, a table in another schema, a file or a table function is refused, and so is a tag parameter the user may not read, an empty window or one longer than reports.max_window.
- **SQL guard → Report output** (data or telemetry). The result goes to the preview, the PDF and the workbook.

The read rights are applied below the query, so no SQL can reach a row the user may not read.

You need to be an Administrator (security administration). Sign-in must be on: with security off, nothing of the module is served.

## The eight rights

| Right | Lets a user | Used in this release |
|---|---|---|
| `reports_view` | Open the **Analytics and Reports** workspace, see the deployed reports and the datasets, run reports on demand, download the files of their own runs, export a dataset as CSV, Excel or Parquet ([Export analytics results](/docs/eaxscada/how-to/export-analytics-results/#2-export-a-saved-dataset)). | Yes |
| `reports_design` | Use the report tools of the designer: the report palette, the preview with real rows, the PDF draft. Preview a dataset. | Yes |
| `datasets_edit` | Create, change and delete datasets (their SQL). | Yes |
| `analytics` | The **Analytics** tab: your own SQL queries, results and charts, saved queries ([Analyse data in the Analytics workspace](/docs/eaxscada/how-to/analyse-data-in-the-analytics-workspace/)). Exports of whole results, extracts across sources and **Pivot on the server** ([Export analytics results](/docs/eaxscada/how-to/export-analytics-results/), [Combine sources with extracts](/docs/eaxscada/how-to/combine-sources-with-extracts/)). Also lets a user preview a dataset. **Save as dataset** also needs `datasets_edit`. | Yes |
| `reports_admin` | See and cancel every user's runs and open every archived run; the **Settings** tab and the SMTP password; every user's schedules, another owner, turning on a schedule restored from another server; the archive's use and the purge; the **May be sent outside** mark of a report. | Yes |
| `reports_schedule` | Create, change, run now and delete the schedules one owns. A schedule's owner must hold it (with `reports_view`) for its runs to happen. | Yes |
| `reports_distribute_external` | Send scheduled reports to e-mail addresses outside eaxScada (allowed domains only). The schedule's owner must hold it at each delivery. | Yes |
| `reports_sign` | Sign archived reports (review, approval), for the steps whose roles one holds. | Yes |

Every route also checks the edition: on Free and Starter every `/api/reports` and `/api/analytics` route answers `403` with code `EDITION`, the Administrator included. The exception is a server that had the module and lost it (a downgrade or a licence expiry): the archive reads stay open, with these rights, so archived reports stay readable ([After a downgrade or a licence expiry](/docs/eaxscada/explanation/analytics-and-reports/#after-a-downgrade-or-a-licence-expiry)). A user without the route's right gets `403` with code `REPORTS_RIGHT`.

## How a right is decided

Each right is a **feature rule** in **Security > Permissions**, with the right's name as its pattern (`reports_view`, or `feature:reports_view`). For a user, in this order:

1. **The AI co-pilot** (an account holding `AI_CoPilot`, whatever its other roles) can only ever hold `reports_view`. Every other right is refused, whatever a rule says.
2. **A DENY rule** that names the right refuses it, the Administrator's too. So does a DENY whose pattern is the catch-all `*` (`feature:*`) or a prefix ending in `*` (`reports*`): the DENY `*` that shuts a person out of every feature shuts them out of Analytics and Reports too.
3. **An ALLOW rule** that names the right grants it.
4. **No rule names the right**: only the Administrator holds it.

The catch-all pattern `*` does **not** grant these rights: a rule written before they existed does not open them. A prefix such as `reports*` in an ALLOW rule grants nothing either.

## New installations

A new installation starts with these rules:

| Role | Rights |
|---|---|
| Administrator | All eight |
| Lead_Engineer | `reports_view`, `reports_design`, `datasets_edit`, `reports_schedule`, `analytics` |
| Process_Supervisor | `reports_view` |
| Shift_Operator | `reports_view` |
| Compliance_Auditor, AI_CoPilot | None |

There is no QA system role: give `reports_sign` (with `reports_view`) to your own QA role so it can sign reports ([Sign a report](/docs/eaxscada/how-to/sign-a-report/)). The signer must also hold a role the report's signature plan names for the step, and be allowed to open the run. Give `reports_distribute_external` only to the owners of schedules that must send outside.

## Existing installations: what to grant after the upgrade

An upgrade does not change your permissions. **Until you add rules, only the Administrator can use Analytics and Reports**: the workspace is hidden for everyone else.

To match a new installation:

1. Open **Security > Permissions** and add a rule for each right of the table above:
   - **Target Role**: the role, for example `Lead_Engineer`;
   - **Target Type**: SCADA Feature;
   - **Action**: `execute` (the action of a feature rule is not read: holding a matching ALLOW rule is holding the right);
   - **Target Subject / Pattern**: the right's name, for example `datasets_edit`;
   - **Effect**: ALLOW.
2. Save. The rights apply at the user's next request; the workspace appears for a user who now holds `reports_view` when the Studio is reloaded.

Grant only what each role needs. A role that runs reports needs `reports_view` only; a role that designs them also needs `reports_design`, and `datasets_edit` if it writes the queries.

## Take a right away

Add the same rule with **Effect**: DENY, on the role, group or user. A DENY wins over every ALLOW, also for the Administrator. For example, DENY `datasets_edit` on a contractors' group lets them design reports from existing datasets without writing SQL.

## AI co-pilot, API tokens and remote access

- **AI co-pilot**: at most `reports_view` (list and run reports with its own read rights). It never designs, edits datasets, schedules, sends, signs, uses analytics or administers. Over HTTP it reaches only the MCP gateway, so no `/api/reports` route is open to it today.
- **API tokens** are refused on every route of the module except listing and starting runs (`GET`, `POST /api/reports/runs`) and downloading a run's file: `403 REPORTS_TOKEN`. Today the API token gate admits only the MCP gateway, so these stay closed as well. A token never signs and never schedules.
- **Remote access through eaxCloud**: reading is a *view* action; changing a dataset, previewing, running, verifying and analytics (queries, exports and extracts) are *engineer* actions; the archive list and the schedules' status are *view*; every signature route (the status included), every schedule change, turning a schedule on or off and run-now, the archive purge (plan, signature, purge), the settings change and the SMTP password are refused remotely ([Allow remote access](/docs/eaxscada/how-to/allow-remote-access/)).

## Check

Sign in as a user of the role. **Analytics and Reports** is on the activity rail when the user holds `reports_view`; the **Datasets** tab appears for users who edit datasets or design reports, **Schedules** for `reports_schedule` and `reports_admin`, **Settings** for `reports_admin`. The **Sign** button appears on runs waiting for a step the user may sign.

## Related

- [Analytics and Reports reference: rights](/docs/eaxscada/reference/analytics-and-reports/#rights)
- [Manage security](/docs/eaxscada/how-to/manage-security/)
- [Security and Part 11: role-based access control](/docs/platform/explanation/security-and-part-11/#5-role-based-access-control-rbac)
