fix: don't allow reports to be spam deleted
This commit is contained in:
parent
3224ce3305
commit
37e68079d8
1 changed files with 4 additions and 0 deletions
|
@ -85,6 +85,10 @@ impl DataManager {
|
|||
}
|
||||
|
||||
pub async fn delete_report(&self, id: usize, user: User) -> Result<()> {
|
||||
if let Err(e) = self.get_report_by_id(id).await {
|
||||
return Err(e);
|
||||
}
|
||||
|
||||
if !user.permissions.check(FinePermission::MANAGE_REPORTS) {
|
||||
return Err(Error::NotAllowed);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue