29 lines
1018 B
Go
29 lines
1018 B
Go
package files
|
|
|
|
// Namespace is the key prefix of one kind of stored file. Every namespace is
|
|
// declared here, so two features cannot share one by accident and then read
|
|
// or delete each other's files. Add a namespace with the first feature that
|
|
// stores such files; the planned owners are noted for reference.
|
|
type Namespace string
|
|
|
|
const (
|
|
// NamespaceResume holds uploaded resume files (TASK-070).
|
|
NamespaceResume Namespace = "resume"
|
|
// NamespaceProfilePDF holds generated standard profile PDFs (FR02).
|
|
NamespaceProfilePDF Namespace = "profile-pdf"
|
|
// NamespaceAccountExport holds personal data exports (TASK-093, TASK-458).
|
|
NamespaceAccountExport Namespace = "account-export"
|
|
)
|
|
|
|
// registeredNamespaces lists every declared namespace for NewPolicy.
|
|
var registeredNamespaces = []Namespace{NamespaceResume, NamespaceProfilePDF, NamespaceAccountExport}
|
|
|
|
func registered(namespace Namespace) bool {
|
|
for _, known := range registeredNamespaces {
|
|
if namespace == known {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|