Repository: revoltchat/backend (language: rust)

Issue:
bug: 403 Error on Role Deletion
### What happened?

I deleted all Channels on my Server because I want to rebuild it and as soon as I wanted to delete the Roles I get in the Console the following error:
![image](https://user-images.githubusercontent.com/105487011/189503797-563511d8-92a9-4ab5-80e8-e1900112c6fd.png)





Discussion / hints:
I am struggling to replicate this. Can you provide some more detail on the steps you took for this? and can you still replicate it?
Heres a Video:
https://user-images.githubusercontent.com/105487011/194683872-8cca1535-635b-48cb-9193-08879a86c4ad.mp4



Fix patch:
diff --git a/crates/delta/src/routes/servers/roles_delete.rs b/crates/delta/src/routes/servers/roles_delete.rs
index 1e3bec706..6d60db1dc 100644
--- a/crates/delta/src/routes/servers/roles_delete.rs
+++ b/crates/delta/src/routes/servers/roles_delete.rs
@@ -13,7 +13,7 @@ pub async fn req(db: &Db, user: User, target: Ref, role_id: String) -> Result<Em
         .throw_permission(db, Permission::ManageRole)
         .await?;
 
-    let member_rank = permissions.get_member_rank().unwrap_or(0);
+    let member_rank = permissions.get_member_rank().unwrap_or(i64::MIN);
 
     if let Some(role) = server.roles.remove(&role_id) {
         if role.rank <= member_rank {


Test patch: