Teams and resource access
Teams are named groups that connect Insights users to shared access. An administrator creates a team, selects its members, and grants the team access to supported Insights resources. Data source and table grants define the shared data boundary. Team permissions can also name dashboard and chart resources.
Team access model
Team access is a group-based path to data. A member can belong to more than one team, and the member receives the combined access granted by those teams. This makes a team useful for a shared work area without requiring a separate grant for every user.
| Team choice | Result |
|---|---|
| Data source | Members can use the tables provided by that source. |
| Individual table | Members can use that table and its data source becomes available. |
| Table restriction | Members see only rows that match the restriction for that table. |
| Dashboard or chart | The team records a supported content resource. Its content visibility remains separate from the data boundary. |
The permission setting controls whether this team-based restriction is active. When it is off, Insights does not use team membership to limit data sources and tables. Administrators keep broad access and manage the teams themselves.
References: insights/…/insights_team.py• L47-54 insights/…/insights_team.py• L95-133 insights/permissions.py• L55-89 frontend/…/PermissionsSettings.vue• L85-97
Member and resource selection
Member selection defines who receives a team grant. Resource selection defines what the team can use. The two selections are saved together, so a change to either one changes the shared access boundary after the team update.
Member selection
The member picker searches enabled Insights users and hides users already in the team. The management dialog shows each chosen member with a name and email, and an administrator can add or remove members before saving.
References: frontend/…/ManageTeamDialog.vue• L36-53 frontend/…/ManageTeamDialog.vue• L109-168 frontend/…/UserSelector.vue• L21-59
Resource selection
The resource picker presents data sources first and reveals their tables when expanded. Selecting a source grants the source-level access path. Selecting tables creates narrower grants. A table can also have a row filter, which adds a data boundary inside the table instead of changing which table the member can open.
The picker loads table choices as needed and restores existing table grants when a team is opened. It turns the current source choices, table choices, and filters into the team’s resource permissions when the dialog is saved.
References: frontend/…/TeamResourceSelector.vue• L14-23 frontend/…/TeamResourceSelector.vue• L36-57 frontend/…/TeamResourceSelector.vue• L61-117 frontend/…/TeamResourceSelector.vue• L234-345
Team creation and management
Team creation starts with a name. Team management then combines membership and resource access in one dialog. This keeps the group definition and the data boundary visible in the same place.
The teams view lists teams by name, owner, and creation time. Administrators can create a team from this view or from the Permissions settings. A team row opens the management dialog for users who can view that team.
References: frontend/…/CreateTeamDialog.vue• L11-35 frontend/…/TeamList.vue• L27-72 frontend/…/PermissionsSettings.vue• L106-134
Team management dialog
The management dialog has two related views: Members and Access. The Members view changes the users in the group. The Access view changes the data sources, tables, and table filters that the group can use. The Done action saves only when the working team differs from the current team.
The built-in Admin team is a protected boundary. It cannot be renamed or deleted, it must keep at least one member, and its members can manage users, teams, and other admin settings. Changes to this team also keep the corresponding Insights admin role aligned with its members. Changes to a user's Insights Admin role also keep Admin team membership aligned.
References: frontend/…/ManageTeamDialog.vue• L28-87 frontend/…/ManageTeamDialog.vue• L170-190 insights/…/insights_team.py• L37-99 insights/…/insights_team.py• L157-185
Shared access flow
The shared access flow starts with an administrator’s team definition and ends with a resource check during a user action. Insights combines all teams for the user, builds the effective source and table sets, and applies any matching table restrictions.
This diagram shows how a team definition becomes the effective data boundary for a user.
flowchart LR
A[Administrator selects members and resources] --> B[Team stores members and grants]
B --> C[User belongs to one or more teams]
C --> D[Insights builds effective sources and tables]
D --> E[Data request checks access]
E --> F[Allowed data]
E --> G[Permission error or no visible data]
A source grant makes all tables in that source available unless the team also has explicit table grants for that source. In that mixed case, the explicit table set narrows the tables available through the source. A table grant makes its source available. If more than one team grants a table filter, a row is available when it matches any one of the collected restrictions. A team grant without a restriction makes the whole table available. Content access remains a separate concern, so a user may still need access to a workbook, chart, or dashboard even when the underlying data is available.
References: insights/…/insights_team.py• L202-222 insights/…/insights_team.py• L241-320 insights/permissions.py• L144-190 insights/permissions.py• L241-324
Relationship to shared content
Teams govern access to data resources. They do not replace content visibility or content editing rules for workbooks, charts, and dashboards. A shared workbook can still be limited by its own access rules, while a team grant supplies the data boundary used when its queries run.
This separation lets a team describe a data audience once and lets content owners decide where that data appears. See Access and collaboration for the wider access model. See Authorization and users, Workbooks, and Dashboard composition for the related user, content, and dashboard models.
References: insights/permissions.py• L15-24 insights/permissions.py• L103-123 CONTEXT.md• L86-104
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the resource types accepted by team validation aligned with the resource types shown or saved by team management screens.
- Keep source-level and table-level grants consistent with the rules that expand effective tables and sources for a user. In particular, preserve the narrowing behavior when both grant types target one source.
- Keep table filter syntax aligned with the data engine that applies filters during table access.
- Keep Admin team membership aligned with the role changes that grant or remove administrator capability.
- Remove team member rows when a user is deleted, so later team saves do not refer to missing users.
- Keep the permission setting behavior aligned with both resource checks and the team list shown to users.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A user has no team while team permissions are enabled | The user receives no permitted sources or tables. | Add the user to a team with the required resource grants. |
| A team grants a source and only some tables from that same source | The explicit table set narrows access to those tables instead of exposing every table in the source. | Use a source grant alone when the user needs all of its tables. |
| A team grants only a table that is not linked to the expected data source | The source list can still include the table’s source, but other tables in that source remain unavailable. | Grant the whole source when the user needs all of its tables. |
| A new or changed table restriction is not a condition on the table’s columns | The team save is rejected when the table schema is known. | Use a condition that names columns from the selected table. |
| A table restriction is checked before the table schema is recorded | The invalid expression can remain until a later data read checks it. | Record the table schema and validate the restriction before relying on the grant. |
| The last Admin team member is removed | The team cannot pass its validation and admin role alignment can become inconsistent. | Keep at least one Admin team member. |
| Team permissions are disabled | Team grants no longer limit data source and table access. | Treat the Permissions setting as a site-wide switch for this access model. |
Key files
| File | Why to read it |
|---|---|
| frontend/…/TeamList.vue | Shows the team list and the entry points for creation and management. |
| frontend/…/ManageTeamDialog.vue | Explains the member and access views and the protected Admin team behavior. |
| frontend/…/TeamResourceSelector.vue | Shows the user-facing model for source, table, and table-filter selection. |
| frontend/…/teams.ts | Shows how team records are loaded and how create, update, and delete actions refresh the shared team state. |
| insights/…/insights_team.py | Defines team membership, supported resource entries, resource expansion, Admin team rules, role alignment, deletion cleanup, and effective access for a user. |
| insights/permissions.py | Shows where team access joins the wider Insights permission checks and data requests. |
| insights/…/user.py | Defines the team data exchanged by the team screens and the team management actions. |