Voile.Schema.Catalog.Attachment (Voile v0.1.27)

Copy Markdown View Source

Summary

Functions

Changeset for updating access control settings. Automatically sets the audit fields.

Get attachments by access level

Get attachments by file type

Determines file type based on mime type

Get attachments for a specific entity

Get attachments that are accessible (not under embargo)

Get primary attachment for an entity

Get attachments that are currently under embargo

Preload access control associations

Functions

access_control_changeset(attachment, attrs, updated_by_user_id)

Changeset for updating access control settings. Automatically sets the audit fields.

by_access_level(query, access_level)

Get attachments by access level

by_file_type(query, file_type)

Get attachments by file type

determine_file_type(mime_type)

Determines file type based on mime type

for_entity(query, entity_id, entity_type)

Get attachments for a specific entity

not_under_embargo(query, current_datetime \\ nil)

Get attachments that are accessible (not under embargo)

primary_for_entity(query, entity_id, entity_type)

Get primary attachment for an entity

under_embargo(query, current_datetime \\ nil)

Get attachments that are currently under embargo

with_access_control(query)

Preload access control associations