{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-10-20T12:30:42Z","object_id":{"id":3094,"is_a":["text","documentation","reference","module"],"name":"doc_external_5_mod_access_url","title":"mod_access_url","uri":"https:\/\/zotonic.com\/id\/3094"},"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-10-20T12:30:42Z","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-10-20T12:30:42Z","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-10-20T12:30:42Z","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-10-20T12:30:42Z","object_id":{"id":2592,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_authorization_and_access_control","title":"Authorization and access control","uri":"https:\/\/zotonic.com\/id\/2592"},"seq":4},{"created":"2026-10-20T12:30:42Z","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-10-20T12:30:42Z","object_id":{"id":2667,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_url","title":"URL","uri":"https:\/\/zotonic.com\/id\/2667"},"seq":6},{"created":"2026-10-20T12:30:42Z","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"}}},"id":3095,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3095"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_external_5_m_access_url","page_url":{"en":"https:\/\/zotonic.com\/docs\/3095\/m_access_url","x-default":"https:\/\/zotonic.com\/docs\/3095\/m_access_url"},"preview_url":null,"resource":{"version":17,"pivot_location_lat":null,"title":"m_access_url","is_authoritative":true,"body":"<p>Generate absolute resource page URLs signed with the current user&#39;s view\npermissions. Requires <code>mod_access_url<\/code> to be enabled. Opening the link does not\nlog the recipient in as the signer; see <code>mod_access_url<\/code> for permissions,\nembedded images, expiry and session grants.<\/p>\n<h2>Model paths<\/h2>\n<h3><code>generate<\/code><\/h3>\n<p>Accepts a payload map with binary keys:<\/p>\n<table class=\"table\"><thead><tr><th>Key<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>id<\/code><\/td><td>Resource ID, name or another reference accepted by <code>m_rsc:rid\/2<\/code>.<\/td><\/tr><tr><td><code>valid_for<\/code><\/td><td>Optional integer duration in seconds or binary date expression such as <code>+day<\/code>. Omit for no expiry.<\/td><\/tr><\/tbody><\/table>\n<p>For example, the admin sharing widget calls this model through Cotonic:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-javascript\">cotonic.broker.call(\n    &quot;bridge\/origin\/model\/access_url\/get\/generate&quot;,\n    {id: 123, valid_for: 3600}\n).then(msg =&gt; console.log(msg.payload.result));\n<\/code><\/pre>\n<p>The result is the signed URL, with HTML <code>&amp;amp;<\/code> separators converted to <code>&amp;<\/code> for\nuse outside template markup. The model callback returns <code>{ok, {Url, Rest}}<\/code> or\n<code>{error, invalid}<\/code> when URL generation returns <code>undefined<\/code>.<\/p>\n<p>Generation requires an authenticated caller and reads the resource property\n<code>page_url_abs<\/code>, which is available without a resource view check. The model does\nnot separately require view or edit permission to generate a URL. Access when\nthe link is opened is still limited by the signer&#39;s view permissions. The admin\nwidget additionally checks resource visibility before offering link generation.\nTreat generated URLs as access credentials.<\/p>\n<h3><code>reload_needed<\/code><\/h3>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% if m.access_url.reload_needed %}\n    {% wire action={reload} %}\n{% endif %}\n<\/code><\/pre>\n<p>Returns a boolean. It is true only for a validated access-URL HTTP request handled\nby <code>controller_page<\/code> or <code>controller_template<\/code> without a <code>cotonic-sid<\/code> cookie.\nOutside an HTTP request it is false. The module&#39;s <code>_html_body.tpl<\/code> already uses\nthis path to establish the browser session needed for subsequent resource grants.<\/p>\n<h2>Erlang API<\/h2>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">Url = m_access_url:generate_url(Id, Context),\nTemporaryUrl = m_access_url:generate_url(Id, 3600, Context).\n<\/code><\/pre>\n<p><code>generate_url\/2<\/code> omits expiry; <code>generate_url\/3<\/code> accepts the same <code>valid_for<\/code> values\nas the model payload. Both return a URL or <code>undefined<\/code> when there is no resource\nURL or the caller is not authenticated. These functions use the same permission\nchecks as the model path. They do not perform the model callback&#39;s <code>&amp;amp;<\/code>\nnormalization.<\/p>","slug":"m_access_url","doc_module_config":[],"is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"c4de372f08607bda634a6f75a924778a1f63ef536f2fdba591bccc87f8112bcb","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"},"external_module_id":{"id":5,"is_a":[],"name":null,"title":null,"uri":"https:\/\/zotonic.com\/id\/5"},"git_url":"https:\/\/github.com\/zotonic\/zotonic_mod_access_url","category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":".\/src\/models\/m_access_url.erl","publication_start":"2026-10-20T12:30:42Z","github_url":"https:\/\/github.com\/zotonic\/zotonic_mod_access_url","pivot_location_lng":null,"doc_source_kind":"external","name":"doc_external_5_m_access_url","is_unfindable":false,"is_published":true,"pivot_geocode":null,"external_module_title":"Access URLs","created":"2026-10-20T12:30:42Z","uri":null,"doc_status":"current","is_dependent":false,"is_external_module":true,"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":"1f353ae6249143f0a1ae35b298a6210170607f71","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-20T12:30:43Z","title_slug":"m_access_url"},"uri":"https:\/\/zotonic.com\/id\/3095","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3095"}},"status":"ok"}