Ensure a grant mutation targets a concrete user or team. `Everyone` is emitted by Storage when listing public grants, but the mutation endpoints require a non-null user or team UUID.
(subject_type: GrantSubjectType)
| 31 | /// `Everyone` is emitted by Storage when listing public grants, but the |
| 32 | /// mutation endpoints require a non-null user or team UUID. |
| 33 | fn validate_mutation_subject(subject_type: GrantSubjectType) -> TeamsResult<()> { |
| 34 | match subject_type { |
| 35 | GrantSubjectType::User | GrantSubjectType::Team => Ok(()), |
| 36 | GrantSubjectType::Everyone => Err(TeamsError::InvalidInput( |
| 37 | "grant mutations require a user or team subject".to_string(), |
| 38 | )), |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // --------------------------------------------------------------------------- |
| 43 | // Organization grants |
no outgoing calls