diff --git a/acp/acp_local_test.go b/acp/acp_local_test.go index fce65e9974..b3763da2a9 100644 --- a/acp/acp_local_test.go +++ b/acp/acp_local_test.go @@ -482,7 +482,7 @@ func Test_LocalACP_InMemory_CheckDocAccess_TrueIfHaveAccessFalseIfNotErrorOtherw policyID, ) - // Invalid empty arguments such that we can't check doc access. + // Invalid empty arguments such that we can't check doc access (read). hasAccess, errCheckDocAccess := localACP.CheckDocAccess( ctx, ReadPermission, @@ -495,6 +495,19 @@ func Test_LocalACP_InMemory_CheckDocAccess_TrueIfHaveAccessFalseIfNotErrorOtherw require.ErrorIs(t, errCheckDocAccess, ErrFailedToVerifyDocAccessWithACP) require.False(t, hasAccess) + // Invalid empty arguments such that we can't check doc access (write). + hasAccess, errCheckDocAccess = localACP.CheckDocAccess( + ctx, + WritePermission, + identity1.DID, + validPolicyID, + "", + "", + ) + require.Error(t, errCheckDocAccess) + require.ErrorIs(t, errCheckDocAccess, ErrFailedToVerifyDocAccessWithACP) + require.False(t, hasAccess) + // Check document accesss for a document that does not exist. hasAccess, errCheckDocAccess = localACP.CheckDocAccess( ctx, @@ -568,7 +581,7 @@ func Test_LocalACP_PersistentMemory_CheckDocAccess_TrueIfHaveAccessFalseIfNotErr policyID, ) - // Invalid empty arguments such that we can't check doc access. + // Invalid empty arguments such that we can't check doc access (read). hasAccess, errCheckDocAccess := localACP.CheckDocAccess( ctx, ReadPermission, @@ -581,6 +594,19 @@ func Test_LocalACP_PersistentMemory_CheckDocAccess_TrueIfHaveAccessFalseIfNotErr require.ErrorIs(t, errCheckDocAccess, ErrFailedToVerifyDocAccessWithACP) require.False(t, hasAccess) + // Invalid empty arguments such that we can't check doc access (write). + hasAccess, errCheckDocAccess = localACP.CheckDocAccess( + ctx, + WritePermission, + identity1.DID, + validPolicyID, + "", + "", + ) + require.Error(t, errCheckDocAccess) + require.ErrorIs(t, errCheckDocAccess, ErrFailedToVerifyDocAccessWithACP) + require.False(t, hasAccess) + // Check document accesss for a document that does not exist. hasAccess, errCheckDocAccess = localACP.CheckDocAccess( ctx,