Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object-level / instance-level / row-level 权限控制 #37

Closed
sdsy888 opened this issue Jun 3, 2021 · 2 comments
Closed

object-level / instance-level / row-level 权限控制 #37

sdsy888 opened this issue Jun 3, 2021 · 2 comments

Comments

@sdsy888
Copy link

sdsy888 commented Jun 3, 2021

看了项目的权限控制这块,我的理解是可以实现model-level的权限控制,请问能实现实例级别或者对象级别(数据库行级别)的权限控制吗?

举例讲,现有的permission可以实现对自定义model的所有实例增删改查的控制; 如果要实现分别将不同实例分配给不同的用户,请问要怎么实现呢?

@TianPangJi
Copy link
Owner

看了项目的权限控制这块,我的理解是可以实现model-level的权限控制,请问能实现实例级别或者对象级别(数据库行级别)的权限控制吗?

举例讲,现有的permission可以实现对自定义model的所有实例增删改查的控制; 如果要实现分别将不同实例分配给不同的用户,请问要怎么实现呢?

我认为官方文档可以解决你的问题(对象级权限控制):
https://www.django-rest-framework.org/api-guide/permissions/#object-level-permissions

@sdsy888
Copy link
Author

sdsy888 commented Jun 7, 2021

谢谢,我研究一下.

@sdsy888 sdsy888 closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants