I've got the answer

the permission format used in DjangoPermissionName is
<app.permission_code_name>
in my example, it's 'main.printdriver_developer'

On Oct 22, 11:56 pm, Eric <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I set apache authentication against django's user database. and I want
> to limit a location to a group of people of my django staff.
> I set this in apache's config file like this:
>
>         <Location "/viewvc">
>                   SetHandler cgi-script
>
>                   # authentication method
>                   AuthType Basic
>                   AuthName "Subversion repository"
>                   AuthUserFile /dev/null
>                   AuthBasicAuthoritative Off
>
>                   # require valid user
>                   Require valid-user
>
>                   # use django user database
>                   PythonOption DJANGO_SETTINGS_MODULE mysite.settings
>                   PythonOption DjangoPermissionName
> "printdriver_developer"
>                   PythonAuthenHandler django.contrib.auth.handlers.modpython
>         </Location>
>         ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi
>
> and define model User in models.py of main app like this
>
> class User(models.Model):
>     rights = models.CharField(maxlength=100)
>
>     def __str__(self):
>         return self.rights
>
>     class Meta:
>         permissions = (
>             ("developerWorks_developer", "developerWorks developer"),
>             ("printdriver_developer", "Print Driver developer"),
>             )
>
>     class Admin:
>         pass
>
> but now only superuser can login to visit .../viewvc, why? how can I
> set DjangoPermission to allow people who have printdriver_developer
> permission to visit the page?
>
> Thanks a lot
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to