Endpoints should be visible to all. (#508)

This commit is contained in:
kevgliss 2016-11-17 10:45:26 -08:00 committed by GitHub
parent 5345170a4f
commit a9361fe428
1 changed files with 0 additions and 10 deletions

View File

@ -8,8 +8,6 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com> .. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
""" """
from flask import g
from lemur import database from lemur import database
from lemur.extensions import metrics from lemur.extensions import metrics
from lemur.endpoints.models import Endpoint, Policy, Cipher from lemur.endpoints.models import Endpoint, Policy, Cipher
@ -121,14 +119,6 @@ def render(args):
else: else:
query = database.filter(query, Endpoint, terms) query = database.filter(query, Endpoint, terms)
# we make sure that a user can only use an endpoint they either own are are a member of - admins can see all
if not g.current_user.is_admin:
endpoint_ids = []
for role in g.current_user.roles:
for endpoint in role.endpoints:
endpoint_ids.append(endpoint.id)
query = query.filter(Endpoint.id.in_(endpoint_ids))
return database.sort_and_page(query, Endpoint, args) return database.sort_and_page(query, Endpoint, args)