Merge pull request 'rename role to manage_events' (#556) from reanme-to-event into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled

Reviewed-on: #556
This commit is contained in:
2024-05-28 11:18:50 +02:00
7 changed files with 16 additions and 14 deletions

View File

@ -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))