Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

docs: collections in the library (#75448)

Alex Yarosh33d8adc109d6
diff --git a/docs/data-studio/images/library-data-picker.png b/docs/data-studio/images/library-data-picker.png
new file mode 100644
index 00000000000..7ac591a61af
Binary files /dev/null and b/docs/data-studio/images/library-data-picker.png differ
diff --git a/docs/data-studio/images/library-org.png b/docs/data-studio/images/library-org.png
new file mode 100644
index 00000000000..2fcf0af9154
Binary files /dev/null and b/docs/data-studio/images/library-org.png differ
diff --git a/docs/data-studio/images/publish-table.png b/docs/data-studio/images/publish-table.png
new file mode 100644
index 00000000000..a82cda47421
Binary files /dev/null and b/docs/data-studio/images/publish-table.png differ
diff --git a/docs/data-studio/library.md b/docs/data-studio/library.md
index 452593e30be..07ab782c529 100644
--- a/docs/data-studio/library.md
+++ b/docs/data-studio/library.md
@@ -19,10 +19,12 @@ The Library helps you create a source of truth for analytics by providing a cent
![The Library in Data Studio](./images/library-in-data-studio.png)
-The Library is a special section in the navigation sidebar of the main Metabase app that you curate in [Data Studio](./overview.md) (and only in Data Studio). Unlike regular collections, each folder in the Library restricts which type of content it contains (which helps keep the Library tidy).
+The Library is a special section in the navigation sidebar of the main Metabase app that you curate in [Data Studio](./overview.md) (and only in Data Studio). It has three root sections — **Data**, **Metrics**, and **Snippets** — each of which restricts the type of content it contains. You can create subcollections within Data and Metrics to further organize content - for example, you can group together tables useful for Marketing or Sales.
## Adding items to the Library
+To add items to the Library:
+
1. Click the grid icon in the upper right.
2. Select **Data Studio**.
3. In the **Library** tab, click **+ New**.
@@ -32,6 +34,32 @@ You can:
- [Publish a table](#publishing-tables)
- [Create a metric](#metrics)
- [Create a SQL snippet or folder](#sql-snippets)
+- [Create a subcollection or snippet folder](#library-organization)
+
+## Library organization
+
+![Library organization](./images/library-org.png)
+
+Library is essentially a special collection. It has three special "subcollections":
+
+- **Data** - for [published tables](#publishing-tables);
+- **Metrics** - for [official metrics](#metrics);
+- **Snippets** - for all the [SQL snippets](#sql-snippets) on your instance.
+
+These special collections are predefined. You can't rename or archive them, (but you can use [ permissions](#library-permissions) to control who sees these collections).
+
+Each of these special collections can have further subcollections. For example, if your Metabase has a lot of published tables, you might want to organize the **Library > Data** collection into "Sales", "Marketing", "Product" subcollections.
+
+People will see the Library structure in the navigation sidebar and in the data picker in the query builder:
+
+![Library organization](./images/library-data-picker.png)
+
+To create a new subcollection for one of the Library's special collections:
+
+1. Go to **Data Studio > Library**.
+2. Click **+ New** in the top right corner.
+3. Under **Collection it's saved in**, select the parent collection.
+4. Add the name and description for the collection and click **Create**.
## Publishing tables
@@ -43,14 +71,18 @@ You must explicitly publish tables to the Library. We use the word "publish" to
Tables published to the Library remain available via the data browser as well.
+To publish a table to the library:
+
+1. Go to **Data Studio > Library**
+
### Managing tables
Once a table is published, you can view and manage its metadata, and more.
- Overview
- Fields
-- [Segments](../data-modeling/segments.md)
-- Measures
+- [Segments](segments.md)
+- [Measures](measures.md)
- [Dependencies](./dependencies/graph.md)
To query a table from the Library in Data Studio:
@@ -77,9 +109,17 @@ If other tables depend on the table you want to unpublish, Metabase will unpubli
Unpublishing a table just removes the table from the Library. That table will still be available via the data browser and data pickers.
+> **Archiving a subcollection unpublishes its tables.** If you archive a Data subcollection, Metabase will automatically unpublish all tables inside it, including tables in any nested subcollections.
+
## Metrics
-[Metrics](../data-modeling/metrics.md) are standardized calculations that people can trust. Only the metrics you save directly to the Library are included.
+[Metrics](../data-modeling/metrics.md) are standardized calculations that people can trust.
+
+Metrics can live in any collection, but metrics in the Library will be prioritized in navigation, search, the query builder, and other places. Use the Library as a place for curated, "official" metrics, like your company's revenue.
+
+To add an already existing metric to the Library, move the metric to the **Library > Metrics** collection (or any of its subcollections).
+
+To create a new Library metric, go to **Data Studio > Library** and select **+ New > Metric**. See [creating metrics](../data-modeling/metrics.md#create-a-metric) for more on building metrics.
## SQL snippets
@@ -91,15 +131,83 @@ You can [sync Library content to version control](../installation-and-operation/
## Library permissions
+Library is essentially a special collection. Metabase uses the standard [collection permissions](../permissions/collections.md) to determine who can view and edit items in the Library, with some caveats. Library collection permissions are only relevant to the Data and Metrics collections. Snippets permissions are handled by [permissions for snippet folders](../permissions/snippets.md).
+
![Library collection permissions](./images/library-permissions.png)
-Metabase uses the standard [collection permissions](../permissions/collections.md) to determine who can view and edit items in the Library. One difference to note is that people in the Data Analyst group always have Curate access to the Library. Like with the Admin group, you can't change the Data Analyst's Curate access to the Library.
+To configure permissions for the library:
+
+1. Go to **Admin > Permissions**.
+2. Switch to **Collections** in the left sidebar.
+3. Select **Curate**, **View**, or **No access** permissions for the Library and its subcollecitons.
+
+ See below for the access that each permission level provides for each part of the Library.
+
+### Curate permissions
+
+- **Data** collection and its subcollections: The group can view tables in the Data collection, provided they have [data permissions](../permissions/data.md) for the tables. But they can't add, edit, or remove tables. The Admin and Data Analyst groups are the _only_ groups that can publish tables to the Library.
+- **Metrics** collection and its subcollections: the group can add, edit, and archive metrics. Groups don't need access to Data Studio to curate metrics.
+
+### View permissions
+
+Controls whether a group can view the Library and its items.
+
+- **Data** and its subcollections: The group can view tables in the Data collection, provided they have [data permissions](../permissions/data.md) for the tables.
+- **Metrics** and its subcollections: the group can view the metrics and use them in their queries.
+
+### No access
+
+Groups with **No access** won't even see the Library (including in the navigation sidebar and the query builder).
+
+The group may still have access to tables published to the Library, if they have [data permissions](../permissions/data.md) to those tables. Do not use collction permissions to **Library > Data** to block access to tables - use [data permissions](../permissions/data.md) instead.
+
+### Permissions to edit the Library
+
+Admins and people in the Data Analyst group always have Curate access to the Library.
+
+There are some caveats through, depending on which part of the Library you're working with.
+
+- **Data** (published tables):
+
+ - Only [admins and data analysts](../people-and-groups/managing.md) can publish tables to the Data section of the Library;
+ - Even if you give "Curate" permissions to **Library > Data** or its subcollections to a non-admin and non-analyst group, people in that group will **not** be able to publish tables. People can only publish tables if they have access to Data Studio, and only admins or data analysts can access Sata Studio.
+
+- **Metrics**:
+
+ - [Admins and data analysts](../people-and-groups/managing.md) can always manage metrics in the Library and its subollections;
+ - If you give "Curate" permissions to **Library > Metrics** or its subcollections to a non-admin and non-analyst group, people in that group will be able to save or move metrics to those subcollections from the main app only. "Curate" permissions to **Library > Metrics** or subcolelcitons do _not_ give access to Data Studio.
+
+- **Snippets**
+
+ - Snippet management is controlled by [snippet permissions](../permissions/snippets.md) - not regular collection permissions.
+
+The root sections (Data, Metrics, Snippets) have fixed properties and can't be renamed or deleted. Subcollections you create follow the normal collection permission rules.
+
+## Permissions to use Library content
+
+People who have View or Curate collection permissions to the **Library** subcollections will be able to use the content in their queries - with some caveats
+
+- **Data** (published tables):
+
+ - People who have View or Curate collection permissions to **Library > Data** or its subcollections will be able to see published tables the in the navigation sidebar, see the published tables in the query builder, and search for published tables (all restricted to subcollections they have access to, of course).
+
+ - **Don't use collection permissions on the Data subcollections for restricting access to tables**. Use [Data permissions](../permissions/data.md) to control access to tables. Collection permissions on **Library > Data** subcollections only control what people see in navigation and data picker, but do not restrict data access. Collection permissions on Data subcollections are useful when you want to declutter the UI for your users - like removing Sales tables from the default view for Marketing group, without necessarily forbidding Marketing from accessing Sales tables altogether.
+
+ - Use [Data permissions](../permissions/data.md) - not Library collection permissions to control access to the actual data in the tables published to **Library > Data**. Data permissions work the same way in the Library as everywhere else in Metabase.
+
+ - Like with models, if you publish a table to the Library, it will grant query access to a group with view access to the database, even if their group has Create Queries set to No in [data permissions](../permissions/data.md) for that particular table.
+
+- **Metrics**:
+
+ - Only people who have View or Curate collection permissions to **Library > Metrics** or its subcollections will be able use the metrics from the appropriate collections. Removing collection access to a **Library > Metrics** subcollection also blocks any usage of metric there.
+
+- **Snippets**:
-[Data permissions](../permissions/data.md) work the same way in the Library as everywhere else in Metabase. One thing to call out: like with models, if you publish a table to the Library, it will grant query access to a group with view access to the database, even if their group has Create Queries set to No in [data permissions](../permissions/data.md) for that particular table.
+ - Snippet access is controlled by [snippet permissions](../permissions/snippets.md) - not regular collection permissions.
## Further reading
- [Dependency graph](./dependencies/graph.md)
- [Remote sync](../installation-and-operation/remote-sync.md)
-- [Models](../data-modeling/models.md)
- [Metrics](../data-modeling/metrics.md)
+- [Snippets](../questions/native-editor/snippets.md).
diff --git a/docs/exploration-and-organization/collections.md b/docs/exploration-and-organization/collections.md
index 21a0ba19781..b6dc7cb5f67 100644
--- a/docs/exploration-and-organization/collections.md
+++ b/docs/exploration-and-organization/collections.md
@@ -46,7 +46,7 @@ To add an Official badge to a collection, an admin can visit the collection and
The Library is a special collection that helps you create a source of truth for analytics by providing a centrally managed set of curated content. Use the Library to separate authoritative, reusable components from ad-hoc analyses.
-See [Library](../data-studio/library.md).
+See [Library organization](../data-studio/library.md#library-organization).
## Collection permissions
diff --git a/docs/permissions/collections.md b/docs/permissions/collections.md
index 8c9f92328cd..d6e5c5c5eb9 100644
--- a/docs/permissions/collections.md
+++ b/docs/permissions/collections.md
@@ -72,13 +72,13 @@ Just like with data access permissions, collection permissions are _additive_, m
- Changing access to a collection doesn't automatically change access to _existing_ subcollections, but all _new_ subcollections will inherit the access level.
- For example, let's say you have a `Campaigns` collection with a `2025 reports` subcollection, and you change the "Data team" group's access to `Campaigns` from "View" to "Curate". Then by default, Data team will get Curate access to `Campaigns` but will retain only "View" access to `2025 reports`. However, if after these permissions are configured, someone adds a new subcollection `2026 reports`, then Data team will get Curate access to "2026 reports" because new subcollections inherit permissions from the parent collection.
+ For example, let's say you have a `Campaigns` collection with a `2025 reports` subcollection, and you change the "Data team" group's access to `Campaigns` from "View" to "Curate". Then by default, Data team will get Curate access to `Campaigns` but will retain only "View" access to `2025 reports`. However, if after these permissions are configured, someone adds a new subcollection `2026 reports`, then Data team will get Curate access to "2026 reports" because new subcollections inherit permissions from the parent collection.
- To change access for existing subcollections as well, toggle **Also change sub-collections** when changing collection access.
-- A group can be given access to a collection located somewhere within one or more sub-collections _without_ having to have access to every collection "above" it.
+- A group can be given access to a collection located somewhere within one or more sub-collections _without_ having to have access to every collection "above" it.
- For example, if a group had access to the "Super Secret Collection" that's saved several layers deep within a "Marketing" collection that the group lacks access to, the "Super Secret Collection" would show up at the top-most level that the group _does_ have access to.
+ For example, if a group had access to the "Super Secret Collection" that's saved several layers deep within a "Marketing" collection that the group lacks access to, the "Super Secret Collection" would show up at the top-most level that the group _does_ have access to.
## Deleting collections
@@ -114,7 +114,9 @@ A personal collection works just like any other collection except that its permi
### Library collection
-See [Data Studio > Library](../data-studio/library.md)
+See [Permissions for the Library and its subcollections](../data-studio/library.md#library-permissions).
+
+Do not use collection permissions for **Library > Data** to control access to data in published tables. Use [Data permissions](data.md) instead.
### External collections