Sharing Mappings
Sharing Mappings
Collaborate on mappings through list, copy, and admin-bypass patterns
What You'll Learn
- Read any mapping - The catalogue is a shared reference; every analyst can list and inspect every mapping
- Fork by copy -
client.mappings.copy(...)creates an independent mapping owned by you - Admin-bypass edits - Admin or Ops can
update()any mapping for in-place team-wide changes - Permission boundaries - Why
update()on a teammate's mapping raisesPermissionDeniedError
Background: the platform has no ACLs, grants, ownership transfer, or “share” feature. Every mapping has exactly one owner, set at creation time and immutable. Collaboration happens through the three patterns below — see the SDK Manual — Working With Other Users’ Mappings for the full narrative.
# Cell 1 — ParametersUSERNAME = "_FILL_ME_IN_" # Set your email before running# Cell 2 — Connect and provision personasfrom graph_olap import GraphOLAPClientfrom graph_olap.exceptions import PermissionDeniedError
from notebook_setup import provision
personas, conn = provision(USERNAME)analyst = personas["analyst"]admin = personas["admin"]
# Pick a mapping from the catalogue — treat this as "a teammate's mapping"teammate_mapping = analyst.mappings.list(search="tutorial-customer-graph").items[0]print(f"Teammate's mapping: {teammate_mapping.name} (id={teammate_mapping.id}, owner={teammate_mapping.owner_username})")Pattern 1 — Read Any Mapping
The mapping catalogue is a shared reference. Read operations work on any mapping regardless of owner.
# list() returns every mapping on the platform, not just yoursall_mappings = analyst.mappings.list(limit=5)print(f"Catalogue size: {all_mappings.total}")for m in all_mappings.items: print(f" [{m.id}] {m.name} (owner: {m.owner_username})")
# get() and list_versions() work on any mapping idversions = analyst.mappings.list_versions(teammate_mapping.id)print(f"\n{teammate_mapping.name} has {len(versions)} version(s)")Pattern 2 — Fork by Copy
Build on a teammate's mapping without modifying the original. The copy is yours to evolve.
# copy() creates a new mapping owned by the caller, seeded from the source's current versionmy_fork = analyst.mappings.copy(teammate_mapping.id, "MyFork-CustomerGraph")print(f"Source: [{teammate_mapping.id}] {teammate_mapping.name} (owner: {teammate_mapping.owner_username})")print(f"My fork: [{my_fork.id}] {my_fork.name} (owner: {my_fork.owner_username}, version: v{my_fork.current_version})")
# The fork is fully independent — no upstream link, no automatic sync.# If the source mapping evolves, call copy() again to catch up.# You own the fork, so you can update itupdated = analyst.mappings.update( my_fork.id, change_description="Customised description for my analysis", description="My forked copy of the customer graph",)print(f"Updated fork to v{updated.current_version}: {updated.description}")Pattern 3 — Admin-Bypass for Shared Edits
When a mapping the whole team uses needs to change in place, only Admin or Ops can do it.
# Calling update() on a mapping you don't own raises PermissionDeniedError (HTTP 403)# Here we simulate trying to update a mapping owned by someone else.# To demo the boundary we temporarily act as admin, who owns different resources.admin_mapping = admin.mappings.list(owner=admin._config.username, limit=1).items
if admin_mapping: target = admin_mapping[0] try: analyst.mappings.update( target.id, change_description="analyst trying to edit admin's mapping", description="This will fail", ) except PermissionDeniedError as e: print(f"Analyst cannot update admin's mapping: {e}")
# Admin bypasses the ownership check bypassed = admin.mappings.update( target.id, change_description="admin in-place edit on behalf of team", description="Updated by admin for everyone", ) print(f"Admin updated {target.name} to v{bypassed.current_version}")else: print("(No admin-owned mapping available to demo the bypass)")What You Cannot Do
Collaboration features that don't exist on the platform
The platform intentionally does not provide:
- Sharing a mapping with specific teammates (no ACLs or grants)
- Transferring ownership of a mapping
- Merging two mappings
- Querying across multiple mappings in one call
- An upstream/downstream link between a fork and its source
For policy and rationale, see Authorization — §4.1 Collaboration Patterns.
# Cleanup — delete the fork you createdanalyst.mappings.delete(my_fork.id)print(f"Deleted fork {my_fork.name}")Key Takeaways
- The mapping catalogue is shared reference data — every analyst can
list(),get(), andlist_versions()on any mapping mappings.copy(id, new_name)is the collaboration primitive — it creates an independent mapping owned by you- A fork has no upstream link — call
copy()again to pick up the source's latest changes update()on another user's mapping raisesPermissionDeniedError; only Admin or Ops can bypass ownership- There is no "share with user X" feature, no ACL, no transfer of ownership — collaboration is by copy or by admin
See also:
- SDK Manual — Working With Other Users’ Mappings — full narrative walkthrough
- Authorization — §3.1 Data Resources — permission matrix
- API —
POST /mappings/:id/copy— REST reference for admins and integrators - 03_advanced_mappings — hierarchy, versioning, and diffing