mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 07:02:24 +00:00
Some preparations for supporting principal memberships
This commit is contained in:
@@ -57,7 +57,7 @@ pub async fn route_mkcalendar<C: CalendarStore>(
|
||||
root_span: RootSpan,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
let (principal, cal_id) = path.into_inner();
|
||||
if principal != user.id {
|
||||
if !user.is_principal(&principal) {
|
||||
return Err(Error::Unauthorized);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pub async fn route_post<C: CalendarStore, S: SubscriptionStore>(
|
||||
req: HttpRequest,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
let (principal, cal_id) = path.into_inner();
|
||||
if principal != user.id {
|
||||
if !user.is_principal(&principal) {
|
||||
return Err(Error::Unauthorized);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ pub async fn route_report_calendar<C: CalendarStore>(
|
||||
cal_store: Data<C>,
|
||||
) -> Result<impl Responder, Error> {
|
||||
let (principal, cal_id) = path.into_inner();
|
||||
if principal != user.id {
|
||||
if !user.is_principal(&principal) {
|
||||
return Err(Error::Unauthorized);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user