Show each team only its own records
Section titled “Show each team only its own records”This how-to is for builders who need each team to see its own records and not another team’s. OSOS has several ways to do this, and each one controls something different. You will learn which one fits your case, and how to set up each one with a real condition you can copy.
You need:
- Developer access or higher on the module, to change fields, queries and views.
- A tenant administrator for the steps under Administration › Organization and Administration › Access Management, which need the system Admin level.
- The teams set up as groups. See Managing groups.
If your teams work in separate spaces (one per branch or agency), start with Design an app for several branches: stores decide which records a space can see at all.
Which one to use
Section titled “Which one to use”| Pattern | What it controls | Checked by the server | Use it when |
|---|---|---|---|
| A view of the team’s records | Which records one view lists | Yes, on every read through that view. Other views of the entity are not affected. | Each team works from a list of “our records”. |
| A query group as the team | Who is in the team, by a rule instead of by hand | Yes: membership is kept up to date by the server, and the group then works wherever you use it. It does not filter records by itself. | The team is described by a rule, such as everyone whose branch is North. |
| Audience and watchers | Who can submit a service, and who follows all its requests | Yes, on every request read. | The records are requests made through a service. |
| Permissions on a view | Who can open the view at all | Yes. | Each team has its own view, and other teams must not open it. |
You will often combine them: a view filtered to the team’s records (pattern 1), opened only by the people who should use it (pattern 4).
Pattern 1: A view of the team’s records
Section titled “Pattern 1: A view of the team’s records”Give each record an owning team, then show a view that lists only the records of the person’s own teams. Because the condition uses a pointer, one view serves every team.
- On the entity — for example Cases — add a Reference field Owning team. Under Data Source, choose Entity Source and the groups entity. See Reference field. People choose the team on the form, or a reaction fills it.
- Open the entity’s designer: Administration › Applications › Modules, open the module, open Cases, and edit it.
- Select the Queries tab, then + (New Query).
- Add a condition: field Owning team, operator in, value source Pointer, pointer @myGroups.
- Enter the Query Name My team’s cases and select Save Query.
- Create a view and choose My team’s cases under Query. See Create a view.
The condition, as saved:
| Field | Operator | Value |
|---|---|---|
| Owning team | in | @myGroups |
@myGroups stands for every group the person viewing the list belongs to — users groups, role groups, org unit groups and query groups. When the field offers groups, the pointer list also has @myUsersGroups, @myOUGroups, @myRoles and @myQueryGroups, to match only one kind.
By department instead. If records carry the department as a Reference to org units, use Department = @myOrgUnit: each person sees the records of their own organizational unit.
As an expression. With value source Expression instead of Pointer, the same condition is Owning team in:
scope.myGroups()In a field’s Lock Field › Conditional expression, the same idea locks a field for everyone outside the owning team:
!scope.myGroups().some(g => g.dataEntry === value.owning_team?.dataEntry)Expressions that run on the server also offer scope.myGroupsIds(), a plain list of
group ids. See Write expressions.
What the server checks. Whenever someone reads records through this view, the server applies the view’s query. The query belongs to the view: another view of Cases without it lists every record that view’s settings allow. Use pattern 4 to decide who can open which view.
Pattern 2: A query group as the team
Section titled “Pattern 2: A query group as the team”A query group is a group whose members are every user matching a saved query on the Users entity — for example, everyone whose Branch is North. OSOS keeps the membership up to date as people’s details change, so nobody maintains the list.
- Builder: on the Users entity, create a saved query that picks the team, for example Branch = North. See Create a query.
- Administrator: open Administration › Organization › Query Groups and select Add User Query Group.
- Enter the Group Name North staff, choose the saved query in query, and select Save. See Create a query group.
A query group does not hide any records by itself. It is a group like any other, so use it wherever a group is accepted:
-
As the owning team in pattern 1. Pick North staff in the Owning team field; the condition Owning team in @myGroups matches it. To match query groups only, use @myQueryGroups:
Field Operator Value Owning team in @myQueryGroups -
As a service’s audience or watchers — pattern 3.
-
On a view’s permissions — pattern 4.
Pattern 3: Audience and watchers of a service
Section titled “Pattern 3: Audience and watchers of a service”When the records are requests made through a service, who sees them is set on the service, not with a query.
| Setting | Who | What they see |
|---|---|---|
| Audience | The people and groups who may submit the service | The service in the Services Catalog |
| Watchers | The people and groups who follow the service | Every request of the service, in Watching, without acting on it |
| Step owners (in the workflow) | Whoever owns the current step | The requests waiting for them, in Inbox |
The person who submitted a request always sees it in Outbox.
- Open the service’s designer and select the Details tab. For a service it shows the service settings.
- Under Audience, turn on Authenticated. To limit who can submit, pick people in Select Users or teams in Select groups.
- Under Watchers, pick the people in Select Users and the teams in Select groups who should follow every request — for example a quality team.
- Select Save.
The server checks both on every request: only the audience can submit, and the Outbox, Inbox and Watching lists show a request only to its requester, its step owners and the watchers. Full steps, including Anonymous: Choose who can submit it. An administrator can set the same two lists from Administration › Access Management › Group Permissions — see Services and their requests.
Pattern 4: Permissions on each view
Section titled “Pattern 4: Permissions on each view”Give each team its own view, and let only that team open it.
- Create the view, for example North cases, with the query Region = North, and publish it. See Create a view.
- Administrator: open Administration › Access Management › Group Permissions.
- Under Select Group, choose North staff, then select Add Permission.
- In Object, pick the North cases view, and save.
The view is now Restricted: only the people and groups on its list can open it, and the server refuses everyone else. Repeat for each team’s view. Full steps: Give a group access to a view, page, report or service.
Check the result
Section titled “Check the result”- Sign in as a member of one team and open the team’s view. Only that team’s records are listed.
- Sign in as a member of another team. The first team’s records are not listed, and its restricted view does not open.
- For a service, ask a watcher to open Watching. They see the service’s requests.
Troubleshooting
Section titled “Troubleshooting”| Problem | What to check |
|---|---|
| A person sees no records in the team view | Owning team is empty on the records, or names a group the person is not in. |
| A person sees another team’s records | They are in that team’s group too — check their groups, roles and query groups. Or they opened a view without the team query. |
| Someone is missing from a query group | Their user details do not match the group’s query. |
| A team cannot find its restricted view in the sidebar | See the known issue in Give a group access to a view. |
| A watcher does not see a request | They are a watcher of a different service, or not in the watcher group. |
See also
Section titled “See also”Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27