visibility

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package visibility decides who may see a course or a stream.

The rules take domain types and return a decision, so they can be tested without a gRPC context. The package has no database access on purpose: a rule that needs a query has outgrown being a rule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listed

func Listed(user *model.User, course model.Course) bool

Listed reports whether a course belongs in a listing, such as the live courses on the start page. A nil user is anonymous.

func Reachable

func Reachable(user *model.User, course model.Course) bool

Reachable reports whether user may open a course by slug.

Not model.User.IsEligibleToWatchCourse, which answers almost the same question with different rules for signed-in users; unifying them is a behaviour change.

func StreamVisible

func StreamVisible(user *model.User, course model.Course, stream model.Stream) bool

StreamVisible reports whether one stream of a course may be shown to user. It assumes the course itself has already been cleared.

func VisibleStreams

func VisibleStreams(user *model.User, course model.Course) []model.Stream

VisibleStreams returns the streams of a course visible to user, in order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL