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

Read-Only partial realms #1062

Merged
merged 3 commits into from Jan 2, 2019

Conversation

Projects
None yet
3 participants
@kraenhansen
Copy link
Contributor

kraenhansen commented Jan 2, 2019

This fixes #1031 by adding a warning when opening partial Realms from the server and opening the browser in a "Read-Only" mode where no classes, properties nor objects can be created, the permissions sidebar and editing data is disabled. If for some reason some UI is not disabled correctly it also monkey-patches the write method of the Realm to ensure nothing writes to it.

Dialog

skaermbillede 2019-01-02 kl 10 26 39

Note how the user can choose to not show this warning again.

The browser opening a partial Realm in read-only mode

skaermbillede 2019-01-02 kl 11 10 12

Note the hint in the left sidebar, telling the user that it's: Opened as "Read Only"

@kraenhansen kraenhansen self-assigned this Jan 2, 2019

@realm-probot realm-probot bot removed the Thinking Robot label Jan 2, 2019

@kraenhansen kraenhansen merged commit 269e91d into master Jan 2, 2019

1 check passed

continuous-integration/jenkins/pr-head This commit looks good
Details

@kraenhansen kraenhansen deleted the kh/read-only-partial-realms branch Jan 2, 2019

await main.showRealmBrowser({ realm });
}
} else {
throw new Error("Couldn't find the Realm in the /__admin Realm");

This comment has been minimized.

@bmunkholm

bmunkholm Jan 2, 2019

Contributor

perhaps mention which realm? Or is that obvious from the context?

This comment has been minimized.

@kraenhansen

kraenhansen Jan 2, 2019

Author Contributor

You just clicked open on a specific Realm, so yeah - I would say so.

electron.remote.getCurrentWindow(),
{
message:
'You are opening a partial Realm created for a specific device. To ensure other divices do not write to this it will be opened in read-only mode.',

This comment has been minimized.

@bmunkholm

bmunkholm Jan 2, 2019

Contributor

divices -> devices.

But perhaps the wording could be better around "To ensure other divices do not write to this".
Perhaps "client" is a better term than "device"?
Perhaps just:
"You are opening a partial Realm created for a specific client. You can only view the content in read-only mode."

@bmunkholm

This comment has been minimized.

Copy link
Contributor

bmunkholm commented Jan 2, 2019

@kraenhansen Notice I added some comments.

@@ -11,3 +11,4 @@
## Internals
- Fixed the Dockerfile used when testing PRs. ([#1057](https://github.com/realm/realm-studio/pull/1057))
- Removing all existing and future unused locals. ([#1058](https://github.com/realm/realm-studio/pull/1058))
- Ensuring users open partial Realms in a read-only mode. ([#1062](https://github.com/realm/realm-studio/pull/1062))

This comment has been minimized.

@bmunkholm

bmunkholm Jan 2, 2019

Contributor

This has a public effect so shouldn't just be under "internals"?

This comment has been minimized.

@kraenhansen

kraenhansen Jan 2, 2019

Author Contributor

You're right - moving this to the bugfix section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment