Sorry it took so long to respond. Busy week.

On 7/8/06, Chris L <[EMAIL PROTECTED]> wrote:
>
> I've currently set up enabling row level permissions using the meta
> class, e.g. to enable row level permissions for the Mineral model you
> would have:
>
> class Mineral(models.Model):
>     name = models.CharField(maxlength=150)
>     hardness = models.PositiveSmallIntegerField()
>
>     class Admin:
>         pass
>
>     class Meta:
>         unique_together = (('name', 'hardness'),)
>         row_lvl_perms = True

I was actually thinking of having a Meta attribute like 'checker' or something.

    from django.contrib.auth.checkers import RowLevel, ModelLevel

    class Mineral(models.Model):
        name = models.CharField(maxlength=150)
        hardness = models.PositiveSmallIntegerField()

        class Meta:
            checker = RowLevel
            # or use ModelLevel

This should allow for other types of permission checking to be
registered without adding a new attribute for each one. For now, the 2
options for checker could just be basically flags to check... I forget
what this is called at the moment, but something like:

    ModelLevel, RowLevel = 1, 2

Later on, the checker attribute would actually cause something to get
registered a la the generic authorization stuff I'm working on. If
checker is not specified, it would default to ModelLevel.

My ideas regarding this are pretty half-baked at this point, but it's
something to consider.

Joseph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to