MCPcopy Index your code
hub / github.com/cedar-policy/cedar-java / policy_effect_jni_internal

Function policy_effect_jni_internal

CedarJavaFFI/src/interface.rs:857–870  ·  view source on GitHub ↗
(
    env: &mut JNIEnv<'a>,
    policy_jstr: JString<'a>,
)

Source from the content-addressed store, hash-verified

855}
856
857fn policy_effect_jni_internal<'a>(
858 env: &mut JNIEnv<'a>,
859 policy_jstr: JString<'a>,
860) -> Result<JValueOwned<'a>> {
861 if policy_jstr.is_null() {
862 raise_npe(env)
863 } else {
864 let policy_jstring = env.get_string(&policy_jstr)?;
865 let policy_string = String::from(policy_jstring);
866 let policy = Policy::from_str(&policy_string)?;
867 let policy_effect = policy.effect().to_string();
868 Ok(JValueGen::Object(env.new_string(&policy_effect)?.into()))
869 }
870}
871
872#[jni_fn("com.cedarpolicy.model.policy.Policy")]
873pub fn templateEffectJni<'a>(mut env: JNIEnv<'a>, _: JClass, policy_jstr: JString<'a>) -> jvalue {

Callers 3

policyEffectJniFunction · 0.85
policy_effect_test_utilFunction · 0.85

Calls 3

raise_npeFunction · 0.85
ObjectInterface · 0.85
effectMethod · 0.80

Tested by 1