anchor.diff:                      {false, Req1, State1#base_state{log_msg = Reason}}
               end
       end.
  -
   -spec create_from_json(Req :: #wm_reqdata{}, State :: #base_state{},
  -                       RecType :: chef_object_name(),
  -                       ContainerId ::object_id(), ObjectEjson :: ejson_term()) ->
  +                       RecType :: chef_object_name()| chef_cookbook_version,
  +                       ContainerId ::object_id() | {authz_id, AuthzId::object_id()},
  +                       ObjectEjson :: ejson_term()) ->
                                 {true | {halt, 409 | 500}, #wm_reqdata{}, #base_state{}}.
   %% @doc Implements the from_json callback for POST requests to create Chef
   %% objects. `RecType' is the name of the object record being created
  
positive.code:              State#base_state{log_msg = LogMsg}};
          What ->
              %% ignore return value of solr delete, this is best effort.
              chef_object:delete_from_solr(ObjectRec),
              {{halt, 500}, Req, State#base_state{log_msg = What}}
      end.
  
  
negative.code:     UserName = list_to_binary(wrq:get_req_header("x-ops-userid", Req)),
      BypassesChecks = SuperuserBypassesChecks andalso is_superuser(UserName),
      {UserName, BypassesChecks}.
  
  -spec maybe_create_authz(ReqId::binary(), ActorId::object_id(),
                           ContainerId::object_id() | {authz_id, AuthzId::object_id()})
      -> {ok, object_id()} | {error, _}.
  %% @doc Helper function to deal with creating an AuthzId where needed.  If an AuthzId is
  %% passed in the just use that other wise create a new one based on the container AuthzId
  maybe_create_authz(_ReqId, _ActorId, {authz_id, AuthzId}) ->
      {ok, AuthzId};
  maybe_create_authz(ReqId, ActorId, ContainerId) when is_binary(ContainerId) ->
      %% Note: potential race condition.  If we don't have perms, the create will fail.
      %% Although we checked rights above, they could have changed.
      ?SH_TIME(ReqId, chef_authz, create_object_with_container_acl, (ActorId, ContainerId)).
  