Index: __init__.py
===================================================================
--- __init__.py	(revision 25)
+++ __init__.py	(working copy)
@@ -14,7 +14,7 @@
 expose = controllers.expose
 flash = controllers.flash
 
-from turbogears import controllers, view, database, validators, command
+from turbogears import controllers, view, database, validators, command, authorization
 
 class URL(object):
     """Computes URLs.
@@ -49,4 +49,4 @@
         return result
 
 __all__ = ["URL", "expose", "flash", "view", "controllers", 
-           "database", "command", "validators"]
\ No newline at end of file
+           "database", "command", "validators", "authorization"]
\ No newline at end of file
Index: controllers.py
===================================================================
--- controllers.py	(revision 25)
+++ controllers.py	(working copy)
@@ -54,9 +54,12 @@
             output).encode("ascii")
     if isinstance(output, unicode):
         output = output.encode("utf8")
+    # Fix for opera browser
+    if "Opera" in ua.browser and tg_format == "json":
+        cherrypy.response.headerMap["Content-Type"] = "text/plain"
     return output
         
-def expose(html=None, validators=None, tg_format=None):
+def expose(html=None, validators=None, tg_format=None, auth=None):
     """TurboGears verson of CherryPy's expose.
     
     In addition to exposing the method to the web, this expose function will
@@ -82,6 +85,15 @@
     
     def decorator(func):
         def newfunc(self, *args, **kw):
+            # Checking for authorization
+            if auth and not auth._check():
+                return auth.getError()
+            try:
+                if not auth and not self._authorization._check():
+                    return self._authorization.getError()
+            except:
+                pass
+                
             _tg_format = kw.pop("tg_format", tg_format)
             underscore = kw.pop("_", None)
             
