Skip to content

Commit

Permalink
fix bad polar rule + add sea_orm to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fairingrey committed Feb 19, 2022
1 parent 562487b commit b197957
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions polar/users.polar
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ allow_field(user: User, _: Read, other_user: User, field) if
allow_field(_, _: Read, _other_user: User, field: String) if
field in ["created_at", "name", "role"];

## admins can change everything for a user except the password
## admins can update everything for a user except the password
allow(user: User, update: UpdateUser, _other_user: User) if
user.role = Role::Admin and
update.password = nil;
Expand All @@ -30,7 +30,7 @@ allow(user: User, update: UpdateUser, other_user: User) if
## users can update themselves but not their role
allow(user: User, update: UpdateUser, other_user: User) if
user.id = other_user.id and
changes.role = nil;
update.role = nil;

## admins can delete other users
allow(user: User, _: Delete, _other_user: User) if
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ async fn main() -> anyhow::Result<()> {
}

if std::env::var_os("RUST_LOG").is_none() {
std::env::set_var("RUST_LOG", "mixini_server=debug,tower_http=debug")
std::env::set_var(
"RUST_LOG",
"mixini_server=debug,tower_http=debug,sea_orm=debug",
)
}
tracing_subscriber::fmt::init();
server::run().await
Expand Down

0 comments on commit b197957

Please sign in to comment.