Merge pull request 'rename role to manage_events' (#556) from reanme-to-event into main
Reviewed-on: #556
This commit is contained in:
@ -1190,7 +1190,7 @@ impl<'r> FromRequest<'r> for EventUser {
|
||||
let db = req.rocket().state::<SqlitePool>().unwrap();
|
||||
match User::from_request(req).await {
|
||||
Outcome::Success(user) => {
|
||||
if user.has_role(db, "planned_event").await {
|
||||
if user.has_role(db, "manage_events").await {
|
||||
Outcome::Success(EventUser(user))
|
||||
} else {
|
||||
Outcome::Error((Status::Forbidden, LoginError::NotACox))
|
||||
|
@ -9,9 +9,9 @@ use crate::{
|
||||
};
|
||||
|
||||
pub mod boat;
|
||||
pub mod event;
|
||||
pub mod mail;
|
||||
pub mod notification;
|
||||
pub mod planned_event;
|
||||
pub mod schnupper;
|
||||
pub mod user;
|
||||
|
||||
@ -80,7 +80,7 @@ pub fn routes() -> Vec<Route> {
|
||||
ret.append(&mut boat::routes());
|
||||
ret.append(&mut notification::routes());
|
||||
ret.append(&mut mail::routes());
|
||||
ret.append(&mut planned_event::routes());
|
||||
ret.append(&mut event::routes());
|
||||
ret.append(&mut routes![rss, show_rss, show_list, list]);
|
||||
ret
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ async fn index(
|
||||
|
||||
let mut context = Context::new();
|
||||
|
||||
if user.has_role(db, "cox").await || user.has_role(db, "planned_event").await {
|
||||
if user.has_role(db, "cox").await || user.has_role(db, "manage_events").await {
|
||||
let triptypes = TripType::all(db).await;
|
||||
context.insert("trip_types", &triptypes);
|
||||
}
|
||||
|
Reference in New Issue
Block a user