Commit a1c9a10e46622305085b7433abd07205a71bf2ce
1 parent
93b7f433
Exists in
master
and in
1 other branch
- /admin requires professor '0'
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
serve.py
| @@ -79,7 +79,8 @@ class AdminWebService(object): | @@ -79,7 +79,8 @@ class AdminWebService(object): | ||
| 79 | def __init__(self, app): | 79 | def __init__(self, app): |
| 80 | self.app = app | 80 | self.app = app |
| 81 | 81 | ||
| 82 | - @cherrypy.tools.accept(media='application/json') | 82 | + @cherrypy.tools.accept(media='application/json') # FIXME |
| 83 | + @require(name_is('0')) | ||
| 83 | def GET(self): | 84 | def GET(self): |
| 84 | data = { | 85 | data = { |
| 85 | 'online': self.app.get_online_students(), | 86 | 'online': self.app.get_online_students(), |
| @@ -90,6 +91,7 @@ class AdminWebService(object): | @@ -90,6 +91,7 @@ class AdminWebService(object): | ||
| 90 | # print(dict(data['finished'])) | 91 | # print(dict(data['finished'])) |
| 91 | return json.dumps(data, default=str) | 92 | return json.dumps(data, default=str) |
| 92 | 93 | ||
| 94 | + @require(name_is('0')) | ||
| 93 | def POST(self, **args): | 95 | def POST(self, **args): |
| 94 | # print('POST', args) # FIXME | 96 | # print('POST', args) # FIXME |
| 95 | if args['cmd'] == 'allow': | 97 | if args['cmd'] == 'allow': |