Commits

Graham Higgins committed 97941e6

Remove redundant decorator

Comments (0)

Files changed (1)

shabti/templates/auth_repozepylons/+package+/lib/decorators.py_tmpl

 
 log = logging.getLogger(__name__)
 
-def authorize(permission):
-    
-    """Decorator for authenticating individual actions. Takes a permission 
-    instance as argument(see lib/permissions.py for examples)"""
-    def wrapper(func, self, *args, **kw):
-        if permission.check():
-            return func(self, *args, **kw)
-        pylons.session['redirect'] = \
-                pylons.request.environ['pylons.routes_dict']
-        pylons.session.save()
-        redirect_to_login()
-    return decorator(wrapper)
-
-
 def require(predicate):
     """
     Make repoze.what verify that the predicate is met.
-
+    
     :param predicate: A repoze.what predicate.
     :return: The decorator that checks authorization.
-
+    
     """
-
+    
     @decorator
     def check_auth(func, *args, **kwargs):
         environ = request.environ
             # TODO: We should warn the user
             # flash(reason, status='warning')
             abort(401, detail=reason)
-
+        
         return func(*args, **kwargs)
     return check_auth
+