Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Validate access mode for API functions #66

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

feltech
Copy link
Member

@feltech feltech commented Aug 21, 2023

Closes #57. See corresponding PR OpenAssetIO/OpenAssetIO#1050

OpenAssetIO/OpenAssetIO#1016 refined the Context access patterns to formalize the creation of "children" and other related entities via publish to an existing reference. BAL does not yet support this kind of creation, and so should error in the case.

So respond appropriately to Access mode in various API functions, by calling the provided error callback, except in the case of managementPolicy which responds with empty TraitsData objects (signifying "unmanaged").

Note that for consistency, this changes the error message output when attempting to resolve with kWrite access.

@feltech feltech self-assigned this Aug 21, 2023
@feltech feltech requested a review from a team as a code owner August 21, 2023 16:57
@feltech feltech force-pushed the work/57-errorOnCreateRelated branch 2 times, most recently from aba42c0 to 5469eb7 Compare August 21, 2023 17:06
Copy link
Contributor

@elliotcmorris elliotcmorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@feltech feltech force-pushed the work/57-errorOnCreateRelated branch from 5feb74b to 6a9c9dc Compare August 23, 2023 10:36
Closes OpenAssetIO#57. OpenAssetIO/OpenAssetIO#1016 refined the Context access
patterns to formalize the creation of "children" and other related
entities via publish to an existing reference. BAL does not yet support
this kind of creation, and so should error in the case.

So respond appropriately to Access mode in various API functions,
by calling the provided error callback, except in the case of
`managementPolicy` which responds with empty `TraitsData` objects
(signifying "unmanaged").

Note that for consistency, this changes the error message output when
attempting to `resolve` with `kWrite` access.

Signed-off-by: David Feltell <david.feltell@foundry.com>
Copy link
Contributor

@foundrytom foundrytom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏

@feltech feltech force-pushed the work/57-errorOnCreateRelated branch from 6a9c9dc to 5c0f358 Compare August 23, 2023 14:30
@feltech feltech merged commit 5e38a2d into OpenAssetIO:main Aug 23, 2023
5 checks passed
@feltech feltech deleted the work/57-errorOnCreateRelated branch August 23, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error if kCreateRelated access used
3 participants