MishkaDocument.Resources.Calculations.AuthoredByMaster (Mishka Document v0.0.1)

Copy Markdown View Source

Whether an issue comment was written by a master — a user with no site.

A tenant admin can read a master's comment but not change it (see MishkaDocument.Resources.Validations.MasterCommentReadOnly), so a tenant's comment list needs to know which comments to draw without Edit and Delete. Loading :contributor under a tenant returns nil for a master, the same as for no author, so this asks MishkaCmsCore.Accounts.Calculations.ByMaster about :contributor_id instead.

A comment whose contributor was deleted has no contributor_id left (on_delete :nilify), so it is no longer a master's.

Summary

Functions

describe(opts)

Callback implementation for Ash.Resource.Calculation.describe/1.

has_calculate?()

has_expression?()

Callback implementation for Ash.Resource.Calculation.has_expression?/0.

init(opts)

Callback implementation for Ash.Resource.Calculation.init/1.

master_ids(user_ids)

@spec master_ids([Ash.UUID.t() | nil]) :: {:ok, MapSet.t()} | {:error, term()}

See MishkaCmsCore.Accounts.Helper.master_ids/1.

strict_loads?()

Callback implementation for Ash.Resource.Calculation.strict_loads?/0.