LabelProjectList returns the IFC label for a list_projects result, joining the per-project labels across every returned project. Public-only results are untrusted and public. All-private results are trusted and private. Mixed public/private results are untrusted and private: public items keep the j
(projectVisibilities []bool)
| 327 | // items keep the joined payload's integrity untrusted, while private items keep |
| 328 | // the joined payload's confidentiality private. |
| 329 | func LabelProjectList(projectVisibilities []bool) SecurityLabel { |
| 330 | var anyPrivate, anyPublic bool |
| 331 | for _, isPrivate := range projectVisibilities { |
| 332 | if isPrivate { |
| 333 | anyPrivate = true |
| 334 | } else { |
| 335 | anyPublic = true |
| 336 | } |
| 337 | } |
| 338 | switch { |
| 339 | case anyPrivate && anyPublic: |
| 340 | return PrivateUntrusted() |
| 341 | case anyPrivate: |
| 342 | return PrivateTrusted() |
| 343 | default: |
| 344 | return PublicUntrusted() |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | // LabelProjectContent returns the IFC label for project results that can include |
| 349 | // item content, field values, or status update bodies. These can aggregate |