简体   繁体   中英

flask-admin How to customize delete button

I want to customize the delete button In flask admin

Here I have logged in through credential of aakash,who is an admin. Asish is normal user and pravin is super admin. AAkash can delete normal user but he can not delete superadmin.In short i want to remove the delete button beside pravin and give delete button beside asish.how to do this?

You can use if condition and check whether the user is normal user, superuser or admin. If the user is admin then you check who are the normal users and make a array and store the normal users. Now you can use a loop to loop the normal users array which we created. In side of the loop you can show your delete button because they are normal users which you want to give a delete button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM