Secure read access to /users endpoint.

- auth field is never returned
- unauthenticated access is rejected
- non-admin users can only access themselves
This commit is contained in:
2016-04-26 10:45:54 +02:00
parent 410cd1fd4c
commit 5c04cdbd6e
4 changed files with 135 additions and 3 deletions

View File

@@ -707,8 +707,11 @@ users = {
'resource_methods': ['GET', 'POST'],
'public_methods': ['GET', 'POST'],
# 'public_item_methods': ['GET'],
'public_methods': [],
# By default don't include the 'auth' field. It can still be obtained
# using projections, though, so we block that in hooks.
'datasource': {'projection': {u'auth': 0}},
'schema': users_schema
}