Data Sources and Tables
Table permissions, relationships, and not leaking one customer's data to another
Data is the whole point of a portal. It’s also the thing that gets you in the paper if you configure it wrong.
Internal apps assume the person logged in is a trusted employee. Portals don’t get that luxury. A customer should see their own orders and nobody else’s. A partner should see their own resources, not a competitor’s. That difference is what this post is about: table permissions, relationships, and access controls that default to “no”.
Step by step
1. Know what’s guarding your data
Power Pages has its own security model, and you need every part of it doing its job:
- Contacts and web roles - every site user is a contact, and a web role is the bundle of permissions you give them
- Table permissions - which tables, which rows and which privileges, assigned to web roles
- Page permissions - who can load which page
Dataverse security roles aren’t part of this. In the standard model Power Pages reads data with its own elevated application user and applies table permissions afterwards. Mapping web roles to Dataverse security roles is what the enhanced authorization model does, and that’s still in preview.
People usually configure one, assume they’re done, and get a surprise.
2. Configure table permissions
Go to the design studio, then Security > Table permissions, and click + New table permission.
Pick the target table - “Case” for support tickets, say - then the permission type:
- Global: every record. Use this sparingly and think twice each time.
- Contact: records related to the signed-in contact through a relationship you pick
- Account: records related to the contact’s parent account, again through a relationship you pick
- Self: only the contact’s own record
Contact and Account access follow the relationship, not who owns the record in Dataverse. If a case isn’t linked to the contact through the relationship you chose, the contact won’t see it. And nothing takes effect until the permission is added to a web role.
Then the access rights: Read to view, Write to update, Create to add, Delete to remove. External users almost never need Delete. Leave it off.
3. Design the relationships
Portal scenarios lean on a few standard shapes.
Parent-child:
Account (Parent) → Contact (Child) → Case (Grandchild)
Many-to-many:
Contact ←→ Product Interest ←→ Product
Lookups:
Case → Product (What product is this case about?)
Case → Priority Level (What's the urgency?)
4. Get specific about rows
Row-level access is table permissions with the right scope, assigned to web roles that match your audiences:
- Portal User: read access to public information
- Customer: their own account data and cases
- Partner: shared resources and collaboration tools
Then the columns. In the standard model, column permissions only apply to the Web API: a column permission profile on a web role decides which columns a call can read, create or update, and forms and lists ignore it. Column security profiles that cover forms, lists and the Web API alike need the enhanced authorization model, which is in preview. Until then, keep the sensitive columns - internal notes, cost prices, whatever would be awkward on a screenshot - out of the views and forms you expose.
What this looks like in practice
TechStart Solutions want a support portal where customers can see their own cases, open new ones, read knowledge base articles, and update their own account details.
That comes out as:
| Table | Permission type | Access rights | Scope |
|---|---|---|---|
| Case | Contact | Read, Write, Create | Own cases only |
| Account | Contact | Read, Write | Own account only |
| Contact | Self | Read, Write | Own record only |
| Knowledge Article | Global | Read | All articles |
| Product | Global | Read | All products |
Global means every row. If only published articles should show, that filter lives in the view or the query - the permission won’t do it for you.
And in a web template, the cases come from a FetchXML query. Cases live in the incident table, and the entities object only loads one row by ID, so a filtered set is a fetchxml block:
<!-- Example: Showing only user's own cases -->
{% fetchxml user_cases %}
<fetch>
<entity name="incident">
<attribute name="title"></attribute>
<attribute name="statuscode"></attribute>
<attribute name="createdon"></attribute>
<filter type="and">
<condition attribute="customerid" operator="eq" value="{{ user.id }}"></condition>
</filter>
<order attribute="createdon" descending="true"></order>
</entity>
</fetch>
{% endfetchxml %}
{% for incident in user_cases.results.entities %}
<div class="case-summary">
<h3>{{ incident.title | escape }}</h3>
<p>Status: {{ incident.statuscode.label | escape }}</p>
<p>Created: {{ incident.createdon | date: "MMM dd, yyyy" }}</p>
</div>
{% endfor %}
Table permissions apply to that query too, so the filter is belt and braces, not the security. And escape on anything a user could have typed.
Note what’s missing: Delete, anywhere. Nobody outside the company gets to remove records.
Patterns for when it gets complicated
Hierarchical access, for organisations with parent and child companies:
Corporate Account
├── Division A
│ ├── Department 1 (users see division and department data)
│ └── Department 2
└── Division B
└── Department 3
Time-boxed access, where the window is the point - training materials only during enrolment, financial reports only in the right quarter, event registration only while registration is open.
Conditional access, based on who someone is - premium customers getting advanced features, certified partners getting specialised resources, regional users getting local content.
How to make a mess and fix it
“Access denied” for someone who should have access. Check the table permissions, then the web roles, then whether that contact record is associated with an account. It’s usually the third one.
Users seeing more than they should. Your permission scope is too broad. Tighten it - Contact or Account instead of Global.
Related data not showing up. The relationship isn’t configured, or there’s no permission on the related table. Both need to be right.
Slow with real data volumes. Index properly, filter in views rather than in the page, and paginate anything that could get long.
Five habits worth keeping
- Least privilege. Give the minimum, add on request.
- Review access periodically. Permissions accumulate.
- Layer your defences. Don’t rely on one control.
- Turn auditing on. You’ll want the trail eventually.
- Test as a real user. Not as an admin. Admins see everything, which is the problem.
Wrapping up
Security here isn’t a checkbox you tick during setup - it’s a set of layers that need to keep matching your business as it changes. Get the permissions model right early and everything you build on top of it inherits it.
Useful links
- Table permissions
- Create and assign web roles
- Column permissions
- Page permissions
- Data workspace
- FetchXML Liquid tag
- Enhanced authorization (preview)
Next: putting this data on actual pages that people want to look at.