livebook/lib/livebook_web/live/hooks/policy_hook.ex
ByeongUk Choi d11084d32f
Add shared mode to Livebook sessions (#1128)
* add shared mode (working)

* add markdown write permission

* Add authorize handle_event

* Revert "add shared mode (working)"

This reverts commit c1e9ebac4d.

* Add assert_policy!

* Apply suggestions code review

* Apply suggestions from code review

* Apply suggestions from code reviews (redirect)

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Add PolicyHook

* remove assert_live_action_access!/1

* Apply suggestions from code review

* Apply suggestions from code review

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-04-28 13:01:53 +02:00

7 lines
224 B
Elixir

defmodule LivebookWeb.PolicyHook do
import Phoenix.LiveView
def on_mount(:private, _params, _session, socket) do
{:cont, socket |> assign(:policy, %{read: true, execute: true, comment: true, edit: true})}
end
end