Hi, I am trying to compare some existing permissions with the
permissions that a project member has. From views.py i am giving a
list with all available permissions. The problem is that the
permission format is different and i cannot think of a slick way to
compare them..My mind hovers around string operations which may solve
my problem but will mess up my code.

{% for permission in available_permissions %} {# permission
format:"our_eco_demo | spreadsheet test | Can delete spreadsheet test"
#}
{{permission}}
{% endfor %}

{% for memberPermission in projectMember.member.get_all_permissions %}
{# permission format: "our_eco_demo.add_point" #}
{{memberPermission}}
{% endfor %}

I was also wondering if a possibility like the following exists,
*
{% for permission in available_permissions %}
    {% if projectMember.member.has_perm.{{permission.codename}} %} {#
since {{permission.codename}} is suitable.. #}
{% endfor %}{% endfor %}
*
Any suggestions? Thanks in advance!

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to