v1.2.32: 修复admin删除资讯权限问题
This commit is contained in:
parent
6cacf7098e
commit
bfa92b307b
|
|
@ -417,6 +417,10 @@ def delete_information(
|
|||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""删除资讯"""
|
||||
# 允许admin删除任何人的资讯
|
||||
if current_user.role == "admin":
|
||||
info = db.query(Information).filter(Information.id == info_id).first()
|
||||
else:
|
||||
info = db.query(Information).filter(
|
||||
Information.id == info_id,
|
||||
Information.user_id == current_user.f99_90_id
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
Loading…
Reference in New Issue