Commit Graph

7244 Commits

Author SHA1 Message Date
Chris Hill-Scott
882fc7ebab Merge pull request #2810 from alphagov/dont-edit-users-from-other-services
Don’t allow editing of users from other services
2019-02-25 17:30:45 +00:00
Chris Hill-Scott
d82f410325 Don’t allow editing of users from other services
Currently when you load the ‘edit user’ page (which has a URL like
`/service/<service_id>/users/<user_id>`) we check that:
- you belong to the service represented by `service_id`
- you have permission to edit users on this service

We don’t check that:
- the user represented by `user_id` belongs to this service

This means that if you could somehow determine another user’s `user_id`
(which I don’t think is possible if you don’t already have the manage
service permission for that service) then you could:
- edit their permissions on your service (weird, but wouldn’t have any
  effect)
- change their email address (bad)

This commit adds checks to return a `404` any time you’re looking at a
service and trying to do stuff to a user who doesn’t belong to that
service.

We can’t add this check to the API easily because there are still times
that we want to get/modify users outside the context of a service (eg
platform admin pages, or users who have no services).
2019-02-25 17:19:07 +00:00
Katie Smith
a8a8e37a46 Merge pull request #2797 from alphagov/change-user-permissions-data-format
Change the format of the user_permissions data that gets sent
2019-02-25 16:33:02 +00:00
Katie Smith
62578f5951 Change the format of the user_permissions data that gets sent
The endpoint for setting permissions in api will now be used for both
user permissions and a user's folder permissions, so this changes the
format of the data we pass through.
2019-02-25 16:00:09 +00:00
Chris Hill-Scott
6ac713c978 Merge pull request #2808 from alphagov/edit-link-space
Add space between email address and edit link
2019-02-25 15:23:28 +00:00
Chris Hill-Scott
3bd4f52db0 Add space between email address and edit link
It was all getting a bit cramped.
2019-02-25 15:15:00 +00:00
Chris Hill-Scott
96e02d1c18 Merge pull request #2799 from alphagov/template-nav-order
Put template type navigation in correct order
2019-02-25 15:12:13 +00:00
Chris Hill-Scott
83fe8b8d9a Merge pull request #2806 from alphagov/save-same-email
Don’t error if email address hasn’t changed
2019-02-25 14:40:05 +00:00
Chris Hill-Scott
a08c8584be Merge pull request #2798 from alphagov/roadmap-feb19
Updated roadmap
2019-02-25 14:37:49 +00:00
Chris Hill-Scott
110fa0ee5a Update app/templates/views/roadmap.html
Co-Authored-By: yahoopete <peter.herlihy@digital.cabinet-office.gov.uk>
2019-02-25 14:29:31 +00:00
Chris Hill-Scott
ffaa8cd1a6 Don’t error if email address hasn’t changed
When updating a user’s email address you currently get an validation
error if you save without changing it. Instead it should just obey your
command. And no need for the confirmation step because nothing is
actually changing.
2019-02-25 12:04:07 +00:00
Pea (Malgorzata Tyczynska)
9cd311df02 Merge pull request #2794 from alphagov/edit_user_email
Allow users with "manage_service" permission to edit team members' email addresses
2019-02-25 10:18:34 +00:00
Chris Hill-Scott
8aeb203124 Put template type navigation in correct order
We always talk about the things you can send using Notify as _emails,
text messages and letters_, in that order.

The navigation should reflect this.
2019-02-22 17:19:39 +00:00
Pea Tyczynska
909e42fae2 Clear new email address from session after transaction 2019-02-22 16:20:54 +00:00
Pea Tyczynska
6c406ae5cd Redirect from confirmation page if session empty 2019-02-22 16:13:46 +00:00
Pete Herlihy
e7c1286309 Updated roadmap 2019-02-22 15:24:43 +00:00
Chris Hill-Scott
4b8788aea8 Merge pull request #2793 from alphagov/remove-extra-api-call
Remove redundant API call
2019-02-22 15:04:09 +00:00
Leo Hemsted
fa2a3ce2c0 Merge pull request #2787 from alphagov/reqs
pyexcel reqs bumps
2019-02-22 14:41:54 +00:00
Tom Byers
4ca5a8b986 Merge pull request #2770 from alphagov/announce-selection-count-to-assistive-tech
Announce selection count to assistive tech
2019-02-22 11:02:44 +00:00
karlchillmaid
5d66ef46a6 Merge pull request #2796 from alphagov/update-new-template-titles
To keep the H1 titles of new templates consistent with the sticky menu options:

* change `Add email template` to `New email template`
* change `Add text message template` to `New text message template`
* change default letter template name `Untitled` to `New letter template`
2019-02-21 21:18:45 +00:00
Leo Hemsted
6178357237 pyexcel reqs bumps 2019-02-21 16:39:25 +00:00
Tom Byers
9b180472d2 Fix selection counter on smaller screens 2019-02-21 13:27:18 +00:00
Tom Byers
14553dcfd0 Give context to 'Cancel' and 'Clear' links
Links need to work in isolation from their context
in the page.

This is an attempt at doing that. The one for
'Cancel' is still not ideal but 'Clear selection'
gives more information than 'Clear' about what it
does.

Also adds a 'href' attribute to the link, without
which its accessible role isn't recognised.
2019-02-21 13:27:18 +00:00
Tom Byers
2d85469cd0 Move 'Clear' link out of 'aria-hidden' region 2019-02-21 13:27:18 +00:00
Tom Byers
15104e9d25 Re-position live-region to remove duplication
Adding a visually hidden live-region creates
duplication in the HTML. End result for users of
screen readers are that you get the same text read
out twice.

This adds `aria-hidden` to hide the visible
version and re-positions the live-region one next
to it. That means the live-region text appears in
the same place in the document order as the
visible one so things are announced as expected.
2019-02-21 13:27:18 +00:00
Tom Byers
050a513cf5 Update a11y API when selection count changes
Inserts a hidden live region to ensure changes to
the count are announced.

The live region is hidden because it needs to be
in the initial markup of the page. The visual
counter is part of a larger region which is
inserted/removed from the DOM.

See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
2019-02-21 13:26:14 +00:00
Tom Byers
a8cac953d7 Deal with lost focus when selection cleared
This was missed out of the work on improving focus
on the templates page.

When you clear the current selection, the 'clear'
link disappears so focus needs to be sent
somewhere.
2019-02-21 13:26:14 +00:00
karlchillmaid
66048034c1 Change Add to New
Change `Add` to `New` for template H1
2019-02-21 12:02:21 +00:00
Alexey Bezhan
60b69bc0b5 Merge pull request #2780 from alphagov/service-settings-table
Replace platform admin service setting buttons with forms
2019-02-21 10:57:46 +00:00
Pea Tyczynska
4faf44b5c5 Content changes following consultation with content and design pros :) 2019-02-21 10:54:56 +00:00
Pea Tyczynska
446a17d801 Confirm edit user email changes user email 2019-02-21 10:54:56 +00:00
Pea Tyczynska
3c9c918963 Redirect to confirmation page 2019-02-21 10:53:23 +00:00
Pea Tyczynska
5158377b2e Add a get view and template that enable changing team members email 2019-02-21 10:53:23 +00:00
karlchillmaid
895713f7a9 Updated default letter template name
To keep the H1/titles of new templates consistent with the sticky menu options.

Updated default letter template name from `Untitled` to `New letter template`
2019-02-21 10:51:01 +00:00
Alexey Bezhan
261d90ca4d Add edit_folder_permissions permission
Admin part of alphagov/notifications-api#2356
Adds Folder permissions switch to the platform admin part of service
settings page.
2019-02-20 16:45:12 +00:00
Alexey Bezhan
000d6c3a48 Replace platform admin service setting buttons with forms
Most of the existing platform admin buttons on the service settings
page used to issue GET requests to switch service settings. This
means they weren't protected by CSRF. On top of that as our number
of service permissions increases over time a lot of buttons on the
page made it hard to work with.

To fix these issues we replace most of the buttons with rows in the
platform admin settings table. Each setting has a 'Change' link that
leads to a page with an On/Off switch form.

This removes "research mode" switch completely since we're planning
to deprecate it in the future and we don't expect to switch any new
services into research mode at the moment.

Most service permissions are now handled by a shared endpoint that
is parameterized with the permission name. Some permissions that
require some additional logic before they can be toggled (like document
upload, which requires setting a contact address) have separate
initial endpoints that redirect to `set_service_permission`.

"Archive", "Suspend" and "Resume" actions are kept as buttons since
they display a confirmation banner (which is a CSRF-protected form)
and they're not easily represented as an On/Off switch.
2019-02-20 16:45:12 +00:00
Alexey Bezhan
75fd2d4ffc Add a new boolean radios fields and change forms to use it
This adds a new OnOffField class that implements a boolean field
that is rendered as two On / Off radio buttons. This allows us to
avoid comparing 'on' and 'off' string values in the views since
the field takes care of transforming form data into python booleans.

This also adds a form class that can be used for any single On / Off
switch forms (e.g. service permissions).
2019-02-20 16:45:12 +00:00
Chris Hill-Scott
ddbd4380c9 Merge pull request #2792 from alphagov/Fix-sticky-menu-content
Updated new template menu content
2019-02-20 16:02:39 +00:00
Chris Hill-Scott
fe57d0adc8 Fix tests 2019-02-20 15:54:00 +00:00
karlchillmaid
884734a1b2 Updated button content
Updated button content
2019-02-20 15:05:08 +00:00
karlchillmaid
03a2b28269 Corrected: Add to new folder button
Corrected: Add to new folder button
2019-02-20 14:58:14 +00:00
Chris Hill-Scott
dad8d3bff5 Remove redundant API call
The current user already has a list of service IDs. The current user
- is an API call we have to make anyway to render this page
- is usually cached in Redis
2019-02-20 14:54:16 +00:00
karlchillmaid
aaacf69fdc Updated new template menu content
Updated new template menu content to make it consistent with the `New template` button and `Copy an existing template` page
2019-02-20 14:39:40 +00:00
Chris Hill-Scott
308470af31 Merge pull request #2791 from alphagov/wiltshire.gov.uk
Mark agreement signed by Wiltshire
2019-02-20 13:43:00 +00:00
Chris Hill-Scott
d0c7895a0d Mark agreement signed by Wiltshire 2019-02-20 13:31:37 +00:00
Chris Hill-Scott
9616d0dc2d Merge pull request #2772 from alphagov/branding-spec
Add spec for email/letter branding
2019-02-20 11:30:20 +00:00
Chris Hill-Scott
1e4e149f03 Merge pull request #2788 from alphagov/northtyneside.gov.uk
Mark agreement signed by North Tyneside council
2019-02-20 10:32:01 +00:00
Chris Hill-Scott
25a7bb1ee0 Merge pull request #2790 from alphagov/request-letter-branding-for-edit
Let users who can edit templates request branding
2019-02-20 10:31:39 +00:00
Chris Hill-Scott
d3b8e3e4ea Let users who can edit templates request branding
Because they can see the button, but currently get a `403`…
2019-02-20 10:19:24 +00:00
Chris Hill-Scott
afb61bb038 Mark agreement signed by North Tyneside council 2019-02-19 16:49:08 +00:00