[][src]Function indyrs::ledger::build_auth_rule_request

pub fn build_auth_rule_request(
    submitter_did: &str,
    txn_type: &str,
    action: &str,
    field: &str,
    old_value: Option<&str>,
    new_value: Option<&str>,
    constraint: &str
) -> Box<dyn Future<Item = String, Error = IndyError>>

Builds a AUTH_RULE request. Request to change authentication rules for a ledger transaction.

Arguments

  • txn_type: ledger transaction alias or associated value for which authentication rules will be applied.
  • field: type of an action for which authentication rules will be applied. Can be either "ADD" (to add a new rule) or "EDIT" (to edit an existing one).
  • action: transaction field for which authentication rule will be applied.
  • old_value: (Optional) old value of a field, which can be changed to a new_value (mandatory for EDIT action).
  • new_value:(Optional) new value that can be used to fill the field.
  • constraint: set of constraints required for execution of an action in the following format: { constraint_id - type of a constraint. Can be either "ROLE" to specify final constraint or "AND"/"OR" to combine constraints. role - role of a user which satisfy to constrain. sig_count - the number of signatures required to execution action. need_to_be_owner - if user must be an owner of transaction. metadata - additional parameters of the constraint. } can be combined by { 'constraint_id': <"AND" or "OR"> 'auth_constraints': [<constraint_1>, <constraint_2>] }

    Returns

    Request result as json.