Controlling Django auth user access to specific object instances

前端 未结 3 1181
无人及你
无人及你 2021-01-22 16:34

In my Django project, I have various users created by Django\'s built-in authentication system. Each user can create their own instances of the App model. I would

3条回答
  •  难免孤独
    2021-01-22 17:21

    This is called row-level permissions and it's a very common problem. See here for all the apps that solve it.

    If that particular test is all you need to do, go for a custom solution like yours (though, since it's boilerplate, it's preferable to move it to a decorator). Otherwise, just use an existing app.

提交回复
热议问题