Make organisation settings platform admin only

At the moment the only setting that a normal organisation team member
can change is the name of the organisation is its name. And we don’t
even want them to be able to change this. So this commit hides the
settings page entirely for non-platform-admin users.
This commit is contained in:
Chris Hill-Scott
2019-06-03 13:29:28 +01:00
parent c55c2a2f56
commit 647daa6ca4
2 changed files with 8 additions and 16 deletions

View File

@@ -180,7 +180,7 @@ def cancel_invited_org_user(org_id, invited_user_id):
@main.route("/organisations/<org_id>/settings/", methods=['GET'])
@login_required
@user_has_permissions()
@user_is_platform_admin
def organisation_settings(org_id):
email_branding = 'GOV.UK'
@@ -206,7 +206,7 @@ def organisation_settings(org_id):
@main.route("/organisations/<org_id>/settings/edit-name", methods=['GET', 'POST'])
@login_required
@user_has_permissions()
@user_is_platform_admin
def edit_organisation_name(org_id):
form = RenameOrganisationForm()

View File

@@ -161,24 +161,16 @@ def test_organisation_trial_mode_services_doesnt_work_if_not_platform_admin(
)
def test_organisation_settings(
def test_organisation_settings_platform_admin_only(
client_request,
mock_get_organisation,
organisation_one
):
expected_rows = [
'Label Value Action',
'Organisation name Org 1 Change',
]
page = client_request.get('.organisation_settings', org_id=organisation_one['id'])
assert page.find('h1').text == 'Settings'
rows = page.select('tr')
assert len(rows) == len(expected_rows)
for index, row in enumerate(expected_rows):
assert row == " ".join(rows[index].text.split())
mock_get_organisation.assert_called_with(organisation_one['id'])
client_request.get(
'.organisation_settings',
org_id=organisation_one['id'],
_expected_status=403,
)
def test_organisation_settings_for_platform_admin(