Restrict roles available to invitation and member.update, fixes ST-264

This commit is contained in:
Constantin Graf
2024-06-18 18:48:48 +02:00
committed by Gregor Vostrak
parent 2184b3c835
commit 313cee2db0
6 changed files with 112 additions and 8 deletions

View File

@@ -30,9 +30,14 @@ class InvitationStoreRequest extends FormRequest
'role' => [
'required',
'string',
// TODO: placeholder role should not be allowed
Rule::enum(Role::class),
Rule::enum(Role::class)
->except([Role::Owner, Role::Placeholder]),
],
];
}
public function getRole(): Role
{
return Role::from($this->input('role'));
}
}