I figured out this code to get the permissions of a dynamic module:
def my_view( request ):
...
app_label = module._meta.app_label
add_p = app_label+'.'+module._meta.get_add_permission()
chg_p = app_label+'.'+module._meta.get_change_permission()
del_p = app_label+'.'+module._meta.get_delete_permission()
perm_add = request.user.has_perm( add_p )
perm_chg = request.user.has_perm( chg_p )
perm_del = request.user.has_perm( del_p )
But I think this is ugly, and I'm pretty sure there is a better way
that I can't see now.
Any sugestion?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---