feat: allow mods to delete files #138

Merged
treadful merged 2 commits from feat/mod-rm into main 2026-06-29 04:52:36 +00:00
Owner

Closes #126

Closes #126
feat: allow mods to delete files
All checks were successful
/ test-and-check (pull_request) Successful in 20m26s
88e597a6af
@ -348,6 +348,94 @@ pub fn ban_ip_list(
}
}
/// Remove a file from the server
Author
Owner

This is largely the same as the regular rm command. Consider combining their main logic somewhere.

This is largely the same as the regular `rm` command. Consider combining their main logic somewhere.
treadful marked this conversation as resolved
@ -62,0 +75,4 @@
)
};
Ok((auth_meta, user_meta_maybe))
Author
Owner

This seems inherently confusing and prone to causing issues. Is there a simpler way to do this?

This seems inherently confusing and prone to causing issues. Is there a simpler way to do this?
Author
Owner

The solution was more confusing. Leaving be for now, added a clarifying docstring.

The solution was more confusing. Leaving be for now, added a clarifying docstring.
treadful marked this conversation as resolved
@ -18,3 +19,3 @@
.map_err(|_| ResponseError::NotFound)?;
let subpath = context.req.param::<String>("subpath").unwrap();
let meta = slip_auth::authorize_key_or_mod(
let (auth_meta, user_meta_maybe) = slip_auth::authorize_key_or_mod(
Author
Owner

like I said above, I kind of hate this.

like I said above, I kind of hate this.
treadful marked this conversation as resolved
docs: add more explanation for authorize_key_or_mod
All checks were successful
/ test-and-check (pull_request) Successful in 18m41s
cba626a659
treadful deleted branch feat/mod-rm 2026-06-29 04:52:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
treadful/jot!138
No description provided.