{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-12-03T15:14:58Z","object_id":{"id":335,"is_a":["text","documentation","reference","module"],"name":"doc_core","title":"Zotonic Core","uri":"https:\/\/zotonic.com\/id\/335"},"seq":1}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"subject":{"objects":[{"created":"2026-12-03T15:14:58Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-12-03T15:14:58Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-12-03T15:14:58Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":3},{"created":"2026-12-03T15:14:58Z","object_id":{"id":2603,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_configuration","title":"Configuration","uri":"https:\/\/zotonic.com\/id\/2603"},"seq":4},{"created":"2026-12-03T15:14:58Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":5},{"created":"2026-12-03T15:14:58Z","object_id":{"id":2672,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_html","title":"HTML","uri":"https:\/\/zotonic.com\/id\/2672"},"seq":6},{"created":"2026-12-03T15:14:58Z","object_id":{"id":2685,"is_a":["categorization","keyword","keyword_quality"],"name":"zotonic_topic_security","title":"Security","uri":"https:\/\/zotonic.com\/id\/2685"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"export_revision":18,"id":3204,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3204"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_link_policy","page_url":{"en":"https:\/\/zotonic.com\/docs\/3204\/link_policy","x-default":"https:\/\/zotonic.com\/docs\/3204\/link_policy"},"preview_url":null,"resource":{"version":2,"pivot_location_lat":null,"title":"link_policy","is_authoritative":true,"body":"<p>Link policy for editors and site configuration.<\/p>\n<p><code>m.link_policy.editor[id]<\/code> returns policy for a visible resource; approval controls\nalso require resource edit and property update permission. <code>editor<\/code> without an id\nreturns policy for a new resource (normal insert ACLs still apply on save).\n<code>nofollow<\/code> and <code>noreferrer<\/code> expose the public site defaults, both true when unset.<\/p>\n<p>For example, retrieve approval controls for the resource being edited:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% with m.link_policy.editor[id] as policy %}\n    {% if policy.can_approve %}\n        &lt;p&gt;{_ You can approve external URLs for this page. _}&lt;\/p&gt;\n    {% endif %}\n{% endwith %}\n<\/code><\/pre>\n<p>The editor policy is a map with these fields:<\/p>\n<table class=\"table\"><thead><tr><th>Field<\/th><th>Value<\/th><\/tr><\/thead><tbody><tr><td><code>id<\/code><\/td><td>Resource id, or <code>undefined<\/code> for a new resource.<\/td><\/tr><tr><td><code>can_approve<\/code><\/td><td>Whether the current user may change URL approvals. New resources still require insert permission when saved.<\/td><\/tr><tr><td><code>urls<\/code><\/td><td>List of approved, unescaped URL binaries; empty for a new resource.<\/td><\/tr><tr><td><code>hosts<\/code><\/td><td>Site hostname and host aliases for editor URL classification.<\/td><\/tr><tr><td><code>nofollow<\/code><\/td><td>Boolean default for new external links inserted by eligible editors.<\/td><\/tr><tr><td><code>noreferrer<\/code><\/td><td>Boolean indicating whether external links suppress referrer information.<\/td><\/tr><\/tbody><\/table>\n<p>The model returns <code>enoent<\/code> for an unknown resource, <code>eacces<\/code> for an invisible\nresource, and <code>unknown_path<\/code> for an unsupported model path. The default-setting\npaths <code>m.link_policy.nofollow<\/code> and <code>m.link_policy.noreferrer<\/code> are public.<\/p>\n<p><code>site.link_nofollow<\/code> is a new-link default only for users with approval rights\n(normally <code>use.mod_admin<\/code>, plus permission to edit the resource). For these\neditors, true means the follow checkbox is unchecked after entering a new\nexternal URL; false means checked. They can override this choice per URL.\nAn empty-URL dialog initially shows the checkbox checked; entering a URL\nrecalculates it. Existing external links reflect their stored URL approval.<\/p>\n<p>Users without approval rights see status but no checkbox. Their unapproved\nexternal URLs always receive nofollow, regardless of the configured default;\nexisting resource approvals remain effective. <code>site.link_noreferrer<\/code> applies to\nall users independently of approval and defaults to true.<\/p>\n<p>There are no model write routes: approvals are saved with normal resource updates.<\/p>\n<p><code>resanitize\/2<\/code> re-applies current settings to an editable resource&#39;s stored HTML.\nConfiguration changes do not rewrite historical content automatically. To migrate\nexisting resources, call this function for the desired ids with an authorized\ncontext. It preserves the resource allow-list and checks ordinary update ACLs.\nThis is a direct Erlang API, not a model write path:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">m_link_policy:resanitize(Id, Context).\n<\/code><\/pre>\n<p>It returns <code>{ok, Id}<\/code> or an error from the resource update, such as\n<code>{error, eacces}<\/code> when the context lacks the required permissions.<\/p>","slug":"link_policy","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"18df041a38dcfb6a88f8bd0e962d008071b8160e8fb0ed8dd5c87d842d359a27","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_core\/src\/models\/m_link_policy.erl","publication_start":"2026-12-03T15:14:58Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_core\/src\/models\/m_link_policy.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_link_policy","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-12-03T15:14:58Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_core","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"f5d9083cd1c05bfff847bc9040b9d2092445082b\n","erlang_module":"m_link_policy","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-12-03T15:23:51Z","title_slug":"link_policy"},"uri":"https:\/\/zotonic.com\/id\/3204","uri_template":"https:\/\/zotonic.com\/id\/:id","version":18,"websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3204"}},"status":"ok"}