This project is not covered by Drupal’s security advisory policy.
Adds per-domain access control to Drupal Canvas pages, restricting which affiliate site(s) each visually-built page appears on - the same rules Domain Access already applies to nodes.
Introduction
If you run a multi-site network with the Domain module and build your pages visually with Drupal Canvas, you've probably noticed a gap: Canvas pages are visible on every domain in your network, with no way to restrict them to just one or a few. That's because Canvas stores its pages in a dedicated canvas_page entity that isn't a node, so it can't plug into the node-grants system Domain Access normally relies on. Domain Canvas closes that gap: it lets you assign one or more domains to each Canvas page (or mark it visible on all of them), and enforces that assignment consistently - in page views, in edit/delete permissions, and in the Canvas editor's own page browser.
Features
Adds two fields to Canvas pages: a reference to the domain(s) the page belongs to, and an "all affiliates" toggle for pages meant to appear everywhere.
New pages default to the domain that was active when they were created, so editors don't have to remember to set it manually.
Visitors get a 403 when viewing a page from a domain it isn't assigned to (unless "all affiliates" is set) - mirroring exactly how Domain Access already restricts node visibility.
Editing and deleting a page is restricted to users who both hold the relevant Domain Access permission and belong to the page's assigned domain(s) - reusing Domain Access's own permission model rather than inventing a new one.
Only users allowed to "publish to any domain"/"publish to any assigned domain" can change a page's domain assignment.
Fixes a cross-domain leak in Canvas's own page-browser (the JS editor's content list), which otherwise shows pages from every domain regardless of the one you're currently on.
A bonus admin overview lists all Canvas pages grouped by domain, for site builders who want a bird's-eye view.
Use this module if you're running Domain Access alongside Canvas and need affiliate sites to only show their own pages - for example, a corporate network where each regional site should only display its own landing pages, not every affiliate's.
Post-Installation
Enable the module like any other - no manual configuration step is required to get started. The two domain fields are created automatically on install (and via an update hook if you enable the module on a site that already has existing Canvas pages, so nothing needs to be set up by hand either way).
To assign domains to a page, open that page and use the new "Domain settings" local task (found at /page/{canvas_page}/domain-settings). This lives on the page's normal Drupal page view, not inside the Canvas visual editor itself - Canvas's editor currently has no extension point for adding this kind of control inline, so it's a separate, lightweight form instead.
No new permissions need to be granted for day-to-day editing: this module reuses Domain Access's existing permissions (edit domain content, delete domain content, create domain content, publish to any domain, publish to any assigned domain). The only permission this module adds is access domain canvas content, which governs the optional admin overview at /admin/content/domain-canvas.
Additional Requirements
Domain and its Domain Access submodule - required, since this module extends Domain Access's rules and permissions to Canvas pages instead of duplicating them.
Drupal Canvas (^1.9) - required, since this module's fields and access rules apply specifically to the canvas_page entity Canvas provides.
Drupal core ^10.2 or ^11.
Recommended modules/libraries
None beyond the required dependencies above. Any module that builds additional functionality on top of Domain Access (e.g. domain-aware menus, blocks, or redirects) will continue to work as expected alongside Domain Canvas.
Similar projects
There is no other module providing domain-based access control specifically for Canvas pages at this time. This module is a direct extension of Domain Access, applying the same access rules and permissions Domain Access already provides for nodes and users to Canvas's separate canvas_page entity type, which Domain Access cannot reach on its own.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Content display, Content editing experience
- By guietc on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
