Making roles more apparent for certificates and authorities. (#327)
This commit is contained in:
@@ -30,6 +30,13 @@ class RoleOutputSchema(LemurOutputSchema):
|
||||
users = fields.Nested(UserNestedOutputSchema, many=True)
|
||||
|
||||
|
||||
class RoleNestedOutputSchema(LemurOutputSchema):
|
||||
__envelope__ = False
|
||||
id = fields.Integer()
|
||||
name = fields.String()
|
||||
description = fields.String()
|
||||
|
||||
|
||||
role_input_schema = RoleInputSchema()
|
||||
role_output_schema = RoleOutputSchema()
|
||||
roles_output_schema = RoleOutputSchema(many=True)
|
||||
|
@@ -9,8 +9,6 @@
|
||||
|
||||
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
|
||||
"""
|
||||
from flask import g
|
||||
|
||||
from lemur import database
|
||||
from lemur.roles.models import Role
|
||||
from lemur.users.models import User
|
||||
@@ -102,13 +100,6 @@ def render(args):
|
||||
if authority_id:
|
||||
query = query.filter(Role.authority_id == authority_id)
|
||||
|
||||
# we make sure that user can see the role - admins can see all
|
||||
if not g.current_user.is_admin:
|
||||
ids = []
|
||||
for role in g.current_user.roles:
|
||||
ids.append(role.id)
|
||||
query = query.filter(Role.id.in_(ids))
|
||||
|
||||
if filt:
|
||||
terms = filt.split(';')
|
||||
query = database.filter(query, Role, terms)
|
||||
|
Reference in New Issue
Block a user