Prevent two users from editing the same data

前端 未结 4 1946
醉梦人生
醉梦人生 2021-01-13 18:46

I have seen a feature in different web applications including Wordpress (not sure?) that warns a user if he/she opens an article/post/page/whatever from the database, while

4条回答
  •  情歌与酒
    2021-01-13 19:19

    Yeah, that's great and should work fine.

    In addition, I'd add the possibility for user B to break the lock - if that's at all wanted!

    That is, the possibility to replace A's lock by B's. This way, you could avoid the time restraint, and they would see 'Hey, this is being edited by A, and this lock is XXX seconds/minutes old. Do you want to break this lock?'.

    With nice users (i.e. no malicious admins), this approach may be better than having just 100 seconds to edit something - sometimes you just need more time.

提交回复
热议问题