Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Dataverse/Security
Reference · Dataverse

Security

Part of Dataverse. Install the skill and your agent reads this page when it needs the depth.

Security in Dataverse: who reads which rows

Security role, business unit, owner team, row scope and column security, with the risk of Organization scope. Authorization inside the flow belongs to power-automate; the rule that scope on the screen is UX and not a control is default-decisions.md A3 -- here is what to do in Dataverse so that the barrier really exists.

Contents

  1. The model in one table
  2. Security role and access level
  3. The risk of Organization scope
  4. Row isolation: owner team + business unit
  5. Column security
  6. Application profile × security role
  7. How to test outside the app
  8. Decision and risk record

1. The model in one table

Piece What it controls Granularity
Security role Privileges (create, read, write, delete, append, append to, assign, share) per table Table × access level
Access level Which rows the privilege applies to: User, Business unit, Parent: child, Organization Row, by owner and by BU
Business unit (BU) Isolation hierarchy: the row's owner belongs to a BU Tree of units
Owner team / access team A group that can own rows (owner team) or receive access to specific rows (access team) Set of users
Column security Who reads/writes a specific column (column security profile) Column
Gallery filter Nothing security-related: only what the screen shows —

General source: Security roles and privileges and Security concepts in Dataverse. The detail of behavior per access level and BU inheritance was not reconfirmed here [unverified]; the practice of the reference projects is recorded in the Script of §4.

2. Security role and access level

3. The risk of Organization scope

A security role at Organization scope on the app's tables limits which tables the user accesses, not which rows. Effect: any user with access to the environment and the role can read the whole table -- all units -- through Excel, Power BI, the Web API (OData) or any other Dataverse client, regardless of what the app's gallery shows. [verified: reference project] -- risk formally accepted for time and cost reasons.

Points the team tends to underestimate:

If the operation does not need real isolation (the units already see each other; the filter is a convenience), Organization scope is a legitimate choice -- as long as it is recorded as an accepted risk (§8). If it does, go to §4.

4. Row isolation: owner team + business unit

Recommendation for real isolation per unit: Owner Teams + Business Unit. Script ([verified: reference project] as a plan and estimated cost; not executed, by decision):

  1. Define the granularity. One BU/owner team per region (few) is viable. One BU per unit (dozens) costs a lot of administration and was discarded in the reference project; isolating unit from unit within the same region requires one BU per unit.
  2. Create the Owner Teams (one per isolation unit) and link each to its BU.
  3. Change the role's access level from Organization to Business unit (or Parent: child, if the region sees its units).
  4. Assign each row's ownerid to its unit's team, at write time -- through the registration flow, which knows the row's unit. Tables that will undergo this isolation must be born UserOwned (see references/modeling.md): a table's ownership type cannot be changed after it is created [unverified: a claim from a creation script; check Learn before relying on it].
  5. Keep the screen filter, now as a convenience, not as a control.
  6. Test outside the app (§7).

Costs and risks:

5. Column security

To hide one column (sensitive data inside a table everyone reads), use column-level security: mark the column as protected and grant a column security profile to whoever reads/creates/updates.

6. Application profile × security role

They are different layers and do not replace each other:

Application profile Security role
Where it lives App table (perfis + pode_x flags) Dataverse
Who enforces it The app and the flow The server
Bypassed from the client? Yes, if only the app enforces it No
Used for Showing/hiding a button; per-action flag in the flow Blocking access to the data

Permission by profile flag (pode_x), never by profile name (T8); no resolved profile = no access (fail-closed). The flag decides what the app offers and what the flow accepts; the role decides what the data hands to whoever queries it by another path. If only the flag exists, the control belongs to the app.

7. How to test outside the app

The test that isolation exists cannot be done through the screen. With a test account that has only the app's role and belongs to another unit:

GET https://<org>.crm.dynamics.com/api/data/v9.2/<EntitySet>?$select=<coluna>&$top=50

(through the browser authenticated as that account, or through Excel/Power BI connected to Dataverse with it). Expected result: only rows of that account's unit. Returning rows from other units = effective Organization scope. Record the command, the account used (no personal data) and the date.

Do the same for writing (try to update a row from another unit) and for the protected column.

8. Decision and risk record

Choose and write it in the project's ADR (default-decisions.md A3/A4):

Situation Decision Record
Units already see each other; the filter is a convenience Organization scope Formal accepted risk: "any user with the role reads all units through Excel/Power BI/Web API", with owner and date
Isolation per region required Owner Teams + BU Plan for assigning ownerid in the registration flow and on load
Isolation per unit required Reassess the track (SQL + procedures with authorization in the flow) or a BU per unit ADR with the administration cost
Sensitive column Column security Profile and the list of who receives it

Never: a gallery filter as the only control with no recorded risk; Power BI over Dataverse with Organization scope without addressing the risk.

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.