I am using Django Admin Tool and I have very simple model. I want to restrict access to particular password for specific user or specific group. How can I make 3 condition for access 'Yes/No/Never' and when user has got Yes + his group No then he's got access but when Yes + Never then not. And how can I make it working with django-admin-tools permissions system.
from django.db import models
from passwords.objects.labels.models import Label
class Password(models.Model):
class Meta:
db_table = 'passwords'
name = models.CharField(max_length=32)
username = models.CharField(max_length=32)
password = models.CharField(max_length=32)
labels = models.ManyToManyField(Label)
def __unicode__(self):
return self.name
Out of the box, django only supports class-level permissions (in other words, permissions on the table).
There is support for object-level (row level) permissions, but django doesn't come with it implemented out of the box:
Consequently, there are third party apps like django-guardian that enable this functionality.