Lightning.Policies.Exports (Lightning v2.19.0-pre)

View Source

The Bodyguard Policy module for Exports.

Downloading an export archive is exactly project access, so this delegates rather than re-deciding. The previous implementation built a %Project{} from the file's project_id and asked whether the user was a member of it, which could not see scheduled_deletion and so served archives from projects that had been shut down.

Summary

Types

actions()

@type actions() :: :download

Functions

authorize(atom, user, project_file)

@spec authorize(actions(), Lightning.Accounts.User.t(), Lightning.Projects.File.t()) ::
  boolean() | {:error, :forbidden}

Callback implementation for Bodyguard.Policy.authorize/3.