I have a cherry application and some of the views that I want to run, only allowing certain users to view them and send to someone else on the required authorization page.
Is there any way to do this with a special decorator? I think that would be the most elegant option.
Here is a basic example of what I want to do:
class MyApp: @authorization_required def view_page1(self,appID): ... do some stuff ... return html def authorization_required(func):
Can the authorization_required function also accept parameters like allow_group1, allow_group2 when called as a decorator? Or do I need a separate decorator for each group?
python cherrypy decorator authorization permissions
Greg
source share