﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20921	Creating a decorator any_permission_required	fabiobatalha@…	fabiobatalha	"When decorating a view with required_permission the developer can authorize a user to execute a view only if the user have all the perms informed is the decorator.

In some situations it is necessary to allow the user to execute a view if the user have at least one of the allowed permissions. It could happen when some authorizations are controlled in the template level.

For example:

views.py
@any_permission_required(['journalmanager.list_journal', 'journalmanager.list_editor_journal'], login_url=AUTHZ_REDIRECT_URL)
def dash_journal(request, journal_id=None):
    journal = get_object_or_404(models.Journal, id=journal_id)
    return render_to_response('journalmanager/journal_dash.html', {
                              'journal': journal,
                              }, context_instance=RequestContext(request))

template:
        {% if perms.journalmanager.list_journal %}
               INTERFACE FEATURES FOR USERS WITH SIMPLE PERMS
        {% endif %}
        {% if perms.journalmanager.list_editor_journal %}
               INTERFACE FEATURES FOR USERS WITH EDITORS PERMS
        {% endif %}"	New feature	closed	contrib.auth	dev	Normal	wontfix	auth perms required_permission has_perms		Accepted	0	0	0	0	0	0
