OwnerOf

io.eezo.core.OwnerOf
final case class OwnerOf[A, V](name: String, get: A => V)

Which field of a model records its owner: the name storage knows it by, and the way to read it off a row.

Two things because two modules need different halves of the same fact. db renders name into the owner condition of four statements, and http calls get to compare a row's owner with the current user, which is what decides whether a show page offers an edit link. Deriving one from the other is not possible in either direction: a getter cannot be read for a column name at runtime, and a name cannot be turned into a typed getter without a mirror.

It is built at compile time, from a field selector, so the name is the model's own field and not a string somebody typed. See io.eezo.auth.Guard's owning.

Attributes

Source
OwnedStore.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala