{"result":{"depiction_url":null,"edges":{"references":{"objects":[{"created":"2020-05-30T05:48:20Z","object_id":{"id":1274,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_notifications","title":{"_type":"trans","tr":{"en":"Respond to a notification"}},"uri":"https:\/\/zotonic.com\/id\/1274"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"subject":{"objects":[{"created":"2026-09-09T13:47:35Z","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-09-09T13:47:35Z","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-09-09T13:47:35Z","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":3},{"created":"2026-09-09T13:47:35Z","object_id":{"id":2627,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_notification","title":"Notification","uri":"https:\/\/zotonic.com\/id\/2627"},"seq":4},{"created":"2026-09-09T13:47:35Z","object_id":{"id":2653,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_authorize","title":"Authorize","uri":"https:\/\/zotonic.com\/id\/2653"},"seq":5}],"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":1468,"is_a":["text","documentation","reference","notification"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1468"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_notification_acl_is_allowed","page_url":{"en":"https:\/\/zotonic.com\/docs\/1468\/observe_acl_is_allowed-2","x-default":"https:\/\/zotonic.com\/docs\/1468\/observe_acl_is_allowed-2"},"preview_url":null,"resource":{"version":3371,"pivot_location_lat":null,"title":"observe_acl_is_allowed\/2","is_authoritative":true,"body":"<p>Check if a user is authorized to perform an operation on a an object (some resource or module). Observe this\nnotification to do complex or more fine-grained authorization checks than you can do through the ACL rules admin\ninterface. Defaults to <code>false<\/code>.<\/p>\n<p>Type:<\/p>\n<p><a href=\"\/id\/doc_developerguide_notifications#notification-first\">first<\/a><\/p>\n<p>Return:<\/p>\n<p><code>true<\/code> to allow the operation, <code>false<\/code> to deny it or <code>undefined<\/code> to let the next observer decide<\/p>\n<p><code>#acl_is_allowed{}<\/code> properties:<\/p>\n<ul><li>action: <code>view|update|delete|insert|use|atom<\/code><\/li><li>object: <code>term<\/code><\/li><\/ul>\n<h2>Example<\/h2>\n<p>Deny anyone from viewing unpublished resource except those who have update rights on the resource (usually the creator\nand the administrator):<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">observe_acl_is_allowed(#acl_is_allowed{action = view, object = Id}, Context) -&gt;\n    case m_rsc:p_no_acl(Id, is_published_date, Context) of\n        undefined -&gt;\n            %% Let next observer decide\n            undefined;\n        true -&gt;\n            %% Resource is published: let next observer decide\n            undefined;\n        false -&gt;\n            %% Resource is unpublished\n            case z_acl:is_allowed(update, Id, Context) of\n                true -&gt;\n                    %% User has update rights, so let next observer decide\n                    undefined;\n                false -&gt;\n                    %% Deny viewing rights on unpublished resource\n                    false\n            end\n    end;\nobserve_acl_is_allowed(#acl_is_allowed{}, _Context) -&gt;\n    %% Fall through\n    undefined.\n<\/code><\/pre>\n<p>In this observer, we return <code>undefined<\/code> in those cases where we do not want to deny access. We don’t grant the access\nright away but give the next observer the change to decide whether viewing is allowed (for instance, based on the\nresource’s category and content group and the user’s group).<\/p>","slug":"observe_acl_is_allowed-2","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"234e214f4da66eb3654dbb1c5f48b6e3d4c3d06dbabbc98167308a3725bfcf40","is_featured":false,"notification":{"arity":2,"callbacks":[{"arity":2,"name":"observe_acl_is_allowed","signature":"observe_acl_is_allowed\/2","variation":"observe"}],"name":"acl_is_allowed","record":{"action":"undefined","object":"undefined"}},"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":1122,"is_a":["meta","category"],"name":"notification","title":"Notifications","uri":"https:\/\/test.zotonic.com\/id\/1122"},"doc_source_path":"apps\/zotonic_core\/src\/behaviours\/zotonic_observer.erl","publication_start":"2023-01-30T19:23:59Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_core\/src\/behaviours\/zotonic_observer.erl","pivot_location_lng":null,"doc_source_kind":"notification","name":"doc_notification_acl_is_allowed","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:23Z","uri":null,"doc_status":"current","is_dependent":false,"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":"a9af6256d16f0717b59ea8dcf2a2e0565573bdd4\n","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-14T14:00:46Z","title_slug":"observe_acl_is_allowed-2"},"uri":"https:\/\/zotonic.com\/id\/1468","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1468"}},"status":"ok"}