livebook icon indicating copy to clipboard operation
livebook copied to clipboard

Add shared mode to Livebook sessions

Open josevalim opened this issue 3 years ago • 3 comments

We want to add support for sharing Livebook sessions. Shared sessions can only have three permissions:

  • can read
  • can comment (optional)
  • can execute (optional)

Sharing is off by default and must be turned on.

Shared sessions will have a specific URL under /public/sessions/:slug, the slug can be customized. We should use global processes to avoid duplicate slugs. If sharing is revoked, or any of the permissions above, it must reflect immediately on all users accessing it under that slug.

For simplicity, we should start with read-only mode so far and add restrictions to the session LiveView. We should likely store a @policy struct in the LiveView, with the fields read?, write?, execute? and comment?. For the regular usage, all values are true. For shared users, the permissions should be retrieved from the session per above.

josevalim avatar Apr 16 '22 08:04 josevalim

Hi, @josevalim. I have some questions.

Who can change the permissions of each session? (anyone in session?) Are these permissions dependent on each session? (not each user?) If one user changes the permissions of the session, does everyone in the session change the permissions? What should I do if a user wants to have different permissions in one session?

ByeongUkChoi avatar Apr 16 '22 15:04 ByeongUkChoi

Today the notebook only has one type of user, and this type of user can do anything. For now, we are not going to change it. So any user who has the token/password can change permissions.

The shared-mode permissions are per session. Once permission changes, all users connected via the shared-mode have their permissions changed.

For now, we won't allow different permissions per use in one session. It is the same for everyone. We can bring fine-grained control later.

josevalim avatar Apr 16 '22 15:04 josevalim

I closed it by mistake. I'll create it again soon. 😭

ByeongUkChoi avatar Jun 13 '22 23:06 ByeongUkChoi

We decided to focus on alternative sharing variants, as outlined in https://github.com/livebook-dev/livebook/issues/1153#issuecomment-1405625519. We may revisit this in the future, though after further consideration sharing regular session with less permissions doesn't enable significant new use cases in addition to sharing as app, screen sharing, reviews via GitHub and editor access.

jonatanklosko avatar Feb 06 '23 19:02 jonatanklosko