Skip to content

Commit

Permalink
Merge pull request #8640 from kiendang/fix-usercode-repr-markdown
Browse files Browse the repository at this point in the history
Fix UserCode _repr_markdown_ by changing notifications.resolve_object role level access
  • Loading branch information
shubham3121 authored Apr 8, 2024
2 parents 69f6216 + c92a3ad commit 733cb9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 733cb9e

Please sign in to comment.