I added a Meta class which contains the following permissions but i don’t know if its added just by only putting them in Meta class or i need to add something or assign them by a certain way. Here is my code :
class Contractor(models.Model):
contractor_verified = models.BooleanField(default=False)
Employer = models.OneToOneField(Employer)
job_title = models.CharField(max_length=50)
name = models.CharField(max_length=250)
class Meta:
permissions = (
("permission", "perm"),
("bid", "bid"),
("send_request_to_verifier", "send_request_to_verifier"),
("gain_points", "gain_points"),
("loose_points", "loose_points"),
)
and i am sorry if anything is not clear. I just need help on how to add custom permissions to an object which is not an instance of Django User
The django permissions system is only designed out of the box to support User and Group model permissions. From the django docs regarding object permissions: https://docs.djangoproject.com/en/1.3/topics/auth/#handling-object-permissions
If you are looking for generic object-level permissions, there are a slew of available packages here: http://pypi.python.org/pypi?%3Aaction=search&term=django+permissions&submit=search
Some of these simply implement the model level permissions, and some let you define a per instance permission.