fn default_policy_permission() {
        let batch = create_batches(1, 1, &*new_signer())
            .into_iter()
            .nth(0)
            .unwrap();

        {
            let mut on_chain_identities = TestIdentitySource::default();
            on_chain_identities.add_policy(create_policy(
                "default",
                vec![Permission::PermitKey("*".into())],
            ));
            let permission_verifier = on_chain_verifier(on_chain_identities);
            assert!(permission_verifier
                .is_batch_signer_authorized(&batch)
                .unwrap());
        }

        {
            let mut on_chain_identities = TestIdentitySource::default();
            on_chain_identities.add_policy(create_policy(
                "default",
                vec![Permission::DenyKey("*".into())],
            ));
            let permission_verifier = on_chain_verifier(on_chain_identities);
            assert!(!permission_verifier
                .is_batch_signer_authorized(&batch)
                .unwrap());
        }
    }
/// Test that if no roles are set, the default policy is used.
///     1. Set default policy to permit all. Batch should be allowed.
///     2. Set default policy to deny all. Batch should be rejected.
Test that if no roles are set, the default policy is used.
1. Set default policy to permit all. Batch should be allowed.
2. Set default policy to deny all. Batch should be rejected.
Test that if no roles are set the default policy is used . 1 . Set default policy to permit all . Batch should be allowed . 2 . Set default policy to deny all . Batch should be rejected .
fn default_policy_permission() {
        let batch = create_batches(1, 1, &*new_signer())
            .into_iter()
            .nth(0)
            .unwrap();
        {
            let mut on_chain_identities = TestIdentitySource::default();
            on_chain_identities.add_policy(create_policy(
                "default",
                vec![Permission::PermitKey("*".into())],
            ));
            let permission_verifier = on_chain_verifier(on_chain_identities);
            assert!(permission_verifier
                .is_batch_signer_authorized(&batch)
                .unwrap());
        }
        {
            let mut on_chain_identities = TestIdentitySource::default();
            on_chain_identities.add_policy(create_policy(
                "default",
                vec![Permission::DenyKey("*".into())],
            ));
            let permission_verifier = on_chain_verifier(on_chain_identities);
            assert!(!permission_verifier
                .is_batch_signer_authorized(&batch)
                .unwrap());
        }
    }
fn default_policy_permission ( ) { let batch = create_batches ( 1 , 1 , & * new_signer ( ) ) . into_iter ( ) . nth ( 0 ) . unwrap ( ) ; { let mut on_chain_identities = TestIdentitySource :: default ( ) ; on_chain_identities . add_policy ( create_policy ( " " , vec ! [ Permission PermitKey ( " " into ( ) ) ] , ) ) ; let permission_verifier = on_chain_verifier ( on_chain_identities ) ; assert ! ( permission_verifier is_batch_signer_authorized ( batch ) unwrap ( ) ) ; } { let mut on_chain_identities = TestIdentitySource :: default ( ) ; on_chain_identities . add_policy ( create_policy ( " " , vec ! [ Permission DenyKey ( " " into ( ) ) ] , ) ) ; let permission_verifier = on_chain_verifier ( on_chain_identities ) ; assert ! ( permission_verifier is_batch_signer_authorized ( batch ) unwrap ( ) ) ; } }
Test that if no roles are set, the default policy is used.
Test that if no roles are set the default policy is used .