Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mod_acl_*: Do not crash when undefined ACL object is passed in.

  • Loading branch information...
commit 9f107229889acaff4c045aa910b72b3cdee34651 1 parent e9dc599
@arjan arjan authored
View
2  modules/mod_acl_adminonly/mod_acl_adminonly.erl
@@ -38,6 +38,8 @@
-include("zotonic.hrl").
%% @doc Check if the user is allowed to perform Action on Object
+observe_acl_is_allowed(#acl_is_allowed{object=undefined}, _Context) ->
+ undefined;
observe_acl_is_allowed(#acl_is_allowed{action=view, object=Id}, #context{user_id=undefined} = Context) ->
Acl = m_rsc:get_acl_props(Id, Context),
case Acl#acl_props.is_published of
View
2  modules/mod_acl_simple_roles/mod_acl_simple_roles.erl
@@ -50,6 +50,8 @@
%% @doc Check if the user is allowed to perform Action on Object
%% @todo #acl_edge
+observe_acl_is_allowed(#acl_is_allowed{object=undefined}, _Context) ->
+ undefined;
observe_acl_is_allowed(#acl_is_allowed{action=view, object=Id}, #context{user_id=undefined} = Context) ->
is_view_public(Id, Context);
observe_acl_is_allowed(#acl_is_allowed{}, #context{user_id=undefined}) ->
Please sign in to comment.
Something went wrong with that request. Please try again.