Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mod_acl_*: Do not crash when undefined ACL object is passed in.
  • Loading branch information
Arjan Scherpenisse committed Nov 30, 2012
1 parent e9dc599 commit 9f10722
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/mod_acl_adminonly/mod_acl_adminonly.erl
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions modules/mod_acl_simple_roles/mod_acl_simple_roles.erl
Expand Up @@ -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}) ->
Expand Down

0 comments on commit 9f10722

Please sign in to comment.