mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-29 20:52:01 +08:00
only admin and owner can delete app (#810)
This commit is contained in:
parent
5a7b51f809
commit
c13a90ee69
@ -294,6 +294,10 @@ class AppApi(Resource):
|
|||||||
def delete(self, app_id):
|
def delete(self, app_id):
|
||||||
"""Delete app"""
|
"""Delete app"""
|
||||||
app_id = str(app_id)
|
app_id = str(app_id)
|
||||||
|
|
||||||
|
if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
||||||
|
raise Forbidden()
|
||||||
|
|
||||||
app = _get_app(app_id, current_user.current_tenant_id)
|
app = _get_app(app_id, current_user.current_tenant_id)
|
||||||
|
|
||||||
db.session.delete(app)
|
db.session.delete(app)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user