Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Investigate options for returning empty Optional on Database#getDocumentById for Reader-protected documents #331

Open
jesse-gallagher opened this issue Mar 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@jesse-gallagher
Copy link
Collaborator

This showed up in DQL queries: DQL can return note IDs for documents that the executing user can't see, and then loading the document itself with getDocumentById doesn't throw an exception. The exception occurred in the next step: trying to read any value from the document then throws a NotAuthorizedException for "You are not authorized to perform that operation".

Since this is an edge case and the caller often knows when it may occur, it'd make sense to add an OpenDocumentMode flag to implicitly due a secondary check to make sure the document can be opened. Ideally, this check will be a cheap operation that will nonetheless hit this error code.

Unfortunately, in early investigation, it appears that the behavior for this is different when on a local client runtime vs. on a Domino server. In a local test case (even when using a differently-named session), this instead throws "Invalid or nonexistent document" immediately upon trying to open the document.

@jesse-gallagher jesse-gallagher added the enhancement New feature or request label Mar 23, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant