remove unnecessary invocations of has_permissions(..., any_=True)

when added to a service, all users are given the view_activity
permission. So, if that's included in the list, we don't need `any_`,
and we don't need any of the other permissions.
This commit is contained in:
Leo Hemsted
2018-02-27 17:18:26 +00:00
parent 7ddad7c99e
commit bd54dbb40c
7 changed files with 9 additions and 39 deletions

View File

@@ -1752,7 +1752,7 @@ def test_route_permissions(
service_id=service_one['id'],
template_id=fake_uuid
),
['send_texts', 'send_emails', 'send_letters'],
['view_activity', 'send_texts', 'send_emails', 'send_letters'],
api_user_active,
service_one)

View File

@@ -139,7 +139,7 @@ def test_should_be_able_to_view_a_template_with_links(
permissions,
links_to_be_shown,
):
active_user_with_permissions._permissions[service_one['id']] = permissions
active_user_with_permissions._permissions[service_one['id']] = permissions + ['view_activity']
client.login(active_user_with_permissions, mocker, service_one)
response = client.get(url_for(