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

Fix UserCode _repr_markdown_ by changing notifications.resolve_object role level access #8640

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def mark_as_unread(
@service_method(
path="notifications.resolve_object",
name="resolve_object",
roles=DATA_SCIENTIST_ROLE_LEVEL,
roles=GUEST_ROLE_LEVEL,
)
def resolve_object(
self, context: AuthedServiceContext, linked_obj: LinkedObject
Expand Down
8 changes: 8 additions & 0 deletions packages/syft/tests/syft/users/user_code_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# syft absolute
import syft as sy
from syft.client.domain_client import DomainClient
from syft.service.action.action_object import ActionObject
from syft.service.request.request import Request
from syft.service.request.request import UserCodeStatusChange
Expand All @@ -29,6 +30,13 @@ def mock_syft_func_2():
return 1


def test_repr_markdown_not_throwing_error(guest_client: DomainClient) -> None:
guest_client.code.submit(mock_syft_func)
result = guest_client.code.get_by_service_func_name("mock_syft_func")
assert len(result) == 1
assert result[0]._repr_markdown_()


def test_user_code(worker) -> None:
root_domain_client = worker.root_client
root_domain_client.register(
Expand Down