1
You need to build your own permission system.
Django’s built-in permission system is not suited for what you want to do.
Build models for the Project
. Create a ManyToMany relationship between a User
and a Project
through
a Membership
model. This Membership model will have a role
field.
https://docs.djangoproject.com/en/1.10/topics/db/models/#extra-fields-on-many-to-many-relationships has an example that is almost ideally suited for your needs.
You can not do user.has_perm('edit_project', project)
in a template. Django templates do not allow function calls directly with multiple params. I think in your case a custom template tag that takes a User
instance, a Project
instance, and a string describing the desired permission would be the way to go.