View Source ZoonkWeb.Plugs.Course (Zoonk v0.2.0-alpha)
Mounts the course data and permissions.
Link to this section Summary
Functions
Fetches the course's data from the database.
Handles mounting the course data to a LiveView.
Requires a school manager or course teacher to access a page.
Link to this section Functions
@spec fetch_course(Plug.Conn.t(), Keyword.t()) :: Plug.Conn.t()
Fetches the course's data from the database.
@spec on_mount( atom(), Phoenix.LiveView.unsigned_params(), map(), Phoenix.LiveView.Socket.t() ) :: {:cont, Phoenix.LiveView.Socket.t()}
Handles mounting the course data to a LiveView.
on_mount-options
on_mount
options
:mount_course
- Mounts the course from thecourse_slug
paramater.
@spec require_manager_or_course_teacher(Plug.Conn.t(), Keyword.t()) :: Plug.Conn.t()
Requires a school manager or course teacher to access a page.