anchor.diff:              end
       end.
   
  -acl_members(TargetType, AuthorizeeType, AuthzId, Permission) ->
  -    case heimdall_db:acl_membership(TargetType, AuthorizeeType, AuthzId,
  +acl_members(ForType, MemberType, ForId, Permission) ->
  +    case heimdall_db:acl_membership(ForType, MemberType, ForId,
                                       Permission) of
           {error, Error} ->
               throw({db_error, Error});
  
positive.code: add_full_access(TargetType, TargetId, AuthorizeeType, AuthorizeeId) ->
      case {AuthorizeeType, AuthorizeeId} of
          {actor, undefined} ->
              % The user we're giving access to doesn't exist (i.e., this is
              % an actor creation with no requestor) so don't add any access
              ok;
          {actor, superuser} ->
              % The user we're giving access to doesn't exist (i.e., this is
  
negative.code:             List
      end.
  
  make_ejson_part(Permission, ForType, ForId) ->
      {Permission,
       {[{<<"actors">>,
         acl_members(ForType, actor, ForId, Permission)},
        {<<"groups">>,
         acl_members(ForType, group, ForId, Permission)}]}}.
  
  make_ejson_action(Permission, ForType, ForId) ->
      {[{<<"actors">>,
         acl_members(ForType, actor, ForId, Permission)},
        {<<"groups">>,
         acl_members(ForType, group, ForId, Permission)}]}.
  
  make_ejson_acl(ForType, ForId) ->
      {[make_ejson_part(<<"create">>, ForType, ForId),
        make_ejson_part(<<"read">>, ForType, ForId),
        make_ejson_part(<<"update">>, ForType, ForId),
        make_ejson_part(<<"delete">>, ForType, ForId),
        make_ejson_part(<<"grant">>, ForType, ForId)]}.
  
  parse_acl_json(Json, Action) ->
      try
  