It's been a month since the initial release of django-rbac and so far it turned out to be pretty useful for many people. I am therefore happy to have contributed another grain of sand to the open source Django community beach.

In Django, as in any MVC oriented framework, developers have to choose which side to put the logic on: a model method or function, inside a view or in a template tag. Although many recommend putting as little logic as possible in template tags, I know sometimes it is good to have one at hand to keep a healthy equilibrium, otherwise views can grow up fat or methods can spread like lemmings in your models and managers. I have recently added two template tags to django-rbac, to request for permission at model or object_level (RBACGenericPermission or RBACPermission, respectively).

For example, a template rendering a profile page for a user can decide whether or not to show some personal information at rendering time, using the if_rbac_permission tag:

{% if_rbac_permission owner model_inst operation roles %}
    <p>Pau Casals, 45 years old, male</p>
{% else %}
    <p>You cannot view this information</p>
{% endif_rbac_permission %}

I updated the app documentation, there you can find another example on using the template tags. Usage is similar to the manager methods, regarding to kind of arguments and order of them in the call, in order to keep consistency. I also improved a bit the example project, including a template to show how to use the template tags.

Hope you like it!