anchor.diff:  -export([allowed_methods/2,
            create_path/2,
            from_json/2,
  -         resource_exists/2,
  -         to_json/2]).
  +         resource_exists/2]).
   
   init(Config) ->
       chef_wm_base:init(?MODULE, Config).
  
positive.code:                                            role_authz_id = AuthzId}} = State) ->
      chef_wm_base:create_from_json(Req, State, chef_role, {authz_id, AuthzId}, RoleData).
  
  to_json(Req, State) ->
      {all_roles_json(Req, State), Req, State}.
  
  %% @doc Generate a JSON string for a hash of rolename => role URI
  %% pairs.
  %% @end
  %%
  %% TODO: try to extract this to a common function, as this pattern
  %% pops up with a few other endpoints, too
  all_roles_json(Req, #base_state{chef_db_context = DbContext,
                                  organization_name = OrgName}) ->
      RoleNames = chef_db:fetch_roles(DbContext, OrgName),
      RouteFun = ?BASE_ROUTES:bulk_route_fun(role, Req),
      UriMap= [{Name, RouteFun(Name)} || Name <- RoleNames],
      chef_json:encode({UriMap}).
  
  malformed_request_message(Any, _Req, _State) ->
      error({unexpected_malformed_request_message, Any}).
  
negative.code: allowed_methods(Req, State) ->
      {['GET','POST'], Req, State}.
  
  validate_request('GET', Req, #base_state{organization_guid = OrgId} = State) ->
      %% Put a stub chef_role record into the resource_state. This allows us to use shared
      %% code for generating the map of name => URL returned for GET /roles.  OrgId is set via
      %% malformed_request.
      {Req, State#base_state{resource_state = #chef_role{org_id = OrgId}}};
  validate_request('POST', Req, #base_state{resource_state = RoleState} = State) ->
      Body = wrq:req_body(Req),
      {ok, Role} = chef_role:parse_binary_json(Body, create),
  