{"result":{"depiction_url":null,"edges":{"hasreference":{"objects":[{"created":"2026-10-07T11:13:32Z","object_id":{"id":1278,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_rsc","title":"rsc","uri":"https:\/\/zotonic.com\/id\/1278"},"seq":1}],"predicate":{"id":2774,"is_a":["meta","predicate"],"name":"hasreference","title":{"_type":"trans","tr":{"en":"Documentation reference"}},"uri":"https:\/\/zotonic.com\/id\/hasreference"}},"refers":{"objects":[{"created":"2026-10-07T11:13:08Z","object_id":{"id":1278,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_rsc","title":"rsc","uri":"https:\/\/zotonic.com\/id\/1278"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"relation":{"objects":[{"created":"2026-10-07T11:13:32Z","object_id":{"id":1536,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_access_control","title":{"_type":"trans","tr":{"en":"Keep permission checks at the boundary"}},"uri":"https:\/\/zotonic.com\/id\/1536"},"seq":1},{"created":"2026-10-07T11:13:32Z","object_id":{"id":2960,"is_a":["text","documentation","developerguide"],"name":"developer_model_api","title":{"_type":"trans","tr":{"en":"Expose data through a model"}},"uri":"https:\/\/zotonic.com\/id\/2960"},"seq":2},{"created":"2026-10-07T11:13:32Z","object_id":{"id":2955,"is_a":["text","documentation","developerguide"],"name":"developer_datamodel_fixtures","title":{"_type":"trans","tr":{"en":"Install initial content with a datamodel"}},"uri":"https:\/\/zotonic.com\/id\/2955"},"seq":3}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-10-07T11:13:32Z","object_id":{"id":2554,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_how_to_guide","title":"How-to guide","uri":"https:\/\/zotonic.com\/id\/2554"},"seq":1},{"created":"2026-10-07T11:13:32Z","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":2},{"created":"2026-10-07T11:13:32Z","object_id":{"id":2614,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_resource","title":"Resource","uri":"https:\/\/zotonic.com\/id\/2614"},"seq":3},{"created":"2026-10-07T11:13:32Z","object_id":{"id":2665,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_structured_data","title":"Structured data","uri":"https:\/\/zotonic.com\/id\/2665"},"seq":4}],"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":2951,"is_a":["text","documentation","developerguide"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2951"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"developer_resource_properties","page_url":{"en":"https:\/\/zotonic.com\/docs\/2951\/read-and-update-resource-properties","x-default":"https:\/\/zotonic.com\/docs\/2951\/read-and-update-resource-properties"},"preview_url":null,"resource":{"body":{"_type":"trans","tr":{"en":"<p>Use <a href=\"\/id\/1278\" class=\"doc-reference doc-reference-model\"><code>model#rsc<\/code><\/a> to read resources and <code>m_rsc_update<\/code> for writes. Use the supplied request context so the operation keeps the caller&#39;s site and permissions.<\/p>\n<p>In an authorized local test context, with an existing <code>garden_welcome<\/code> resource:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">Id = m_rsc:rid(garden_welcome, C).\nm_rsc:is_visible(Id, C).\nm_rsc:p(Id, title, C).\nm_rsc_update:update(Id, #{&lt;&lt;&quot;summary&quot;&gt;&gt; =&gt; &lt;&lt;&quot;Visit the garden on Saturday.&quot;&gt;&gt;}, C).\n<\/code><\/pre>\n<p>Check that <code>Id<\/code> is an integer before continuing. Expect <code>{ok, Id}<\/code> from a successful update; <code>{error, Reason}<\/code> is a failed write, not a saved page. Read the summary back and check the rendered page. The ordinary <code>z:c(garden)<\/code> shell context does not grant editing permission.<\/p>\n<p>In application code, branch on visibility before returning private properties and on the update result before reporting success. The write API checks access, but you must still select and validate the fields the caller may change. Do not copy every submitted field into the resource or update the SQL table directly.<\/p>"}},"category_id":{"id":317,"is_a":["meta","category"],"name":"developerguide","title":"Developer guide","uri":"https:\/\/zotonic.com\/id\/developerguide"},"content_group_id":{"id":339,"is_a":["meta","content_group"],"name":"default_content_group","title":{"_type":"trans","tr":{"en":"Default Content Group"}},"uri":"https:\/\/zotonic.com\/id\/default_content_group"},"created":"2026-10-07T11:12:56Z","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"doc_editorial_bundle":true,"doc_editorial_edges":{"hasreference":[1278],"relation":[1536,2955,2960],"subject":[2554,2564,2614,2665]},"is_authoritative":true,"is_dependent":false,"is_featured":false,"is_protected":false,"is_published":true,"is_unfindable":false,"language":["en"],"modified":"2026-10-07T11:13:41Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"name":"developer_resource_properties","pivot_geocode":null,"pivot_location_lat":null,"pivot_location_lng":null,"privacy":0,"publication_end":"9999-06-01T00:00:00Z","publication_start":"2026-10-07T11:12:56Z","slug":"read-and-update-resource-properties","summary":{"_type":"trans","tr":{"en":"Use model#rsc for resource access and m_rsc_update for writes. These APIs handle behavior that a direct SQL update would bypass."}},"title":{"_type":"trans","tr":{"en":"Read and update resource properties"}},"title_slug":{"_type":"trans","tr":{"en":"read-and-update-resource-properties"}},"tz":"UTC","uri":null,"version":22,"visible_for":0},"uri":"https:\/\/zotonic.com\/id\/2951","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2951"}},"status":"ok"}