In GAE, restrict certain urls to Admin only is [quite easy](https://developers.google.com/appengine/docs/python/config/appconfig):

```
- url: /admin/.*
  script: admin.app
  login: admin

```

Now I am using Flask. I have to repeat the same code in every admin only function to tell if a user is admin, which makes the code long and redundant. 

```
@app.route('/admin/somepage')
def AdminPage():
   #Figure out if a user is admin

```

Is there some better way to do that?