dimagi / django-prbac

Other
139 stars 38 forks source link

Is object-level permission control available? #70

Closed devnjw closed 10 months ago

devnjw commented 1 year ago

Thank you for your awesome product! I have one question.

I read in the README that django-prbac provides object-level permission, but when I look at the code, I don't see the object relationship being mapped. The examples in the official documentation also don't show any examples of object-level management. How can I do this?

gherceg commented 10 months ago

Hey @devnjw sorry for the very late reply. I'm relatively new to this package myself, but if you're still interested in this I'm happy to try to help. Could you give an example of what you would like to do with object-level management?

devnjw commented 10 months ago

@gherceg Thanks for reply. I thought I saw README tells object-level permission control is available, but I can not find it now. I must have misunderstood.

gherceg commented 10 months ago

I believe the intention of the README section that mentions object level access control was to convey that django-prbac can be used to implement concepts like that, but isn't something that works out of the box with this package. You would be responsible for associating a Role object to the object that you want to control access to, and then only other Roles with access granted to the object's role will have access. Hope that helps clear things up.

gherceg commented 10 months ago

I updated the README to be more aligned with my last comment.

devnjw commented 10 months ago

Thanks @gherceg.