Show only roles that the user is a member of, in list view, for other views show all roles such that certificates and authorities can be shared across teams/groups. (#446)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
|
||||
|
||||
"""
|
||||
from flask import Blueprint
|
||||
from flask import Blueprint, g
|
||||
from flask import make_response, jsonify
|
||||
from flask.ext.restful import reqparse, Api
|
||||
|
||||
@@ -83,6 +83,8 @@ class RolesList(AuthenticatedResource):
|
||||
parser.add_argument('id', type=str, location='args')
|
||||
|
||||
args = parser.parse_args()
|
||||
if not g.current_user.is_admin:
|
||||
args['user_id'] = g.current_user.id
|
||||
return service.render(args)
|
||||
|
||||
@admin_permission.require(http_exception=403)
|
||||
|
Reference in New Issue
Block a user