anchor.diff:      }.
   
   
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Inspects the Data provided during token creation and returns the profile of
  +%% the privileges requested to be included in an invite token.
  +%% @end
  +%%--------------------------------------------------------------------
  +-spec inspect_requested_privileges(tokens:invite_token_type(), entity_logic:data()) ->
  +    privileges_profile().
  +inspect_requested_privileges(InviteTokenType, Data) ->
  +    case {are_invite_privileges_applicable(InviteTokenType), Data} of
  +        {false, _} -> default_privileges;
  +        {true, #{?PRIVILEGES_KEY := _}} -> custom_privileges;
  +        {true, _} -> default_privileges
  +    end.
  +
  +
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Inspects the privileges carried by an invite token (based on Metadata) and
  +%% returns the resolved privileges along with their profile.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec inspect_carried_privileges(tokens:invite_token_type(), metadata()) ->
       {privileges_profile(), invite_privileges()}.
   inspect_carried_privileges(InviteTokenType, Metadata) ->
  
positive.code:     privileges:handle_service_privilege() | privileges:handle_privilege() |
      privileges:harvester_privilege() | privileges:cluster_privilege()
  ).
  % Indicates if invite privileges are default or custom (which requires
  % additional privileges from the token creator)
  -type privileges_profile() :: default_privileges | custom_privileges.
  %% @formatter:on
  -export_type([metadata/0, custom_metadata/0, invite_privileges/0, privileges_profile/0]).
  
negative.code: %%%===================================================================
  %%% API
  %%%===================================================================
  
  %%--------------------------------------------------------------------
  %% @doc
  