pub struct create_service_provider;Expand description
POST /api/v1/service-providers
Réservée au syndic et au superadministrateur.
── Ce que la documentation disait, et ce que le code faisait ────────────
Le commentaire portait déjà « syndic/admin only ». Aucun contrôle ne l’appliquait : la route se contentait de lire l’organisation de l’appelant, si bien qu’un copropriétaire — ou tout rôle authentifié — pouvait inscrire un prestataire au catalogue de son cabinet.
Une règle écrite en commentaire et absente du code est pire qu’une règle absente : la revue la lit, la croit appliquée, et passe à la suite. Le cliquet #864 comptait d’ailleurs cette route parmi celles qui prennent une identité sans s’en servir pour décider — il avait raison, et sur ce point précis, pas sur le cloisonnement qui, lui, était bien là.
Le refus est un 403, pas un 400 : l’appelant est authentifié et son organisation est connue ; ce qui manque est le droit, pas la donnée.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for create_service_provider
impl RefUnwindSafe for create_service_provider
impl Send for create_service_provider
impl Sync for create_service_provider
impl Unpin for create_service_provider
impl UnsafeUnpin for create_service_provider
impl UnwindSafe for create_service_provider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more