Commit Graph

7452 Commits

Author SHA1 Message Date
Chris Hill-Scott
a85ee2a8e9 Merge pull request #2890 from alphagov/lancaster.gov.uk
Mark agreement signed by Lancaster County Council
2019-04-03 11:38:51 +01:00
Chris Hill-Scott
7d680ba37f Mark agreement signed by Lancaster County Council 2019-04-03 11:27:38 +01:00
Chris Hill-Scott
7436a568dd Merge pull request #2884 from alphagov/team-members-not-users
Say ‘team members’ not ‘users’ for permissions
2019-04-02 15:52:49 +01:00
Chris Hill-Scott
70d2b709ce Merge pull request #2887 from alphagov/fix-alignment-sticky-links
Fix alignment of links in sticky footer
2019-04-02 15:52:33 +01:00
Pea (Malgorzata Tyczynska)
3e251783de Merge pull request #2888 from alphagov/folder-user-permissions-2
Only show user permissions section for a folder to users with manage_users permission
2019-04-02 15:34:54 +01:00
Pea Tyczynska
bd66cc220b User permissions section for a folder noy visible if service only has one user
If no manage users permission then don't pass user folder permissions to api
2019-04-02 15:03:41 +01:00
Pea Tyczynska
9d44c45e90 Only users who can manage team members see folder permissions 2019-04-02 12:07:11 +01:00
Alexey Bezhan
8ab859138b Merge pull request #2865 from alphagov/check-folder-permissions
Check folder permissions
2019-04-02 10:33:01 +01:00
Katie Smith
3ae1f30ac9 Merge pull request #2885 from alphagov/phone-number
Pass API correct attribute to search inbound SMS
2019-04-02 09:59:40 +01:00
Chris Hill-Scott
a1a4b7f3d4 Fix alignment of links in sticky footer
The delete link was inheriting 1px of extra top padding meant to align
it when displayed alongside a button. In this case it’s not being
displayed alongside a button, so doesn’t need the extra padding.
2019-04-02 09:59:18 +01:00
Chris Hill-Scott
e7abebebf3 Pass API correct attribute to search inbound SMS
It’s `phone_number` here:
1250e47cc7/app/inbound_sms/rest.py (L33)
2019-04-02 09:17:13 +01:00
Chris Hill-Scott
f1126c8cbb Say ‘team members’ not ‘users’ for permissions
This is consistent with the language we use elsewhere.

Also removes the colon (it’s considered implicit in a form label).
2019-04-01 17:23:16 +01:00
Alexey Bezhan
2478c6b608 Add a temporary check for service folder permission
Since we're calling `User.has_template_folder_permission` directly
in a few places (notably the `folder_path` template macro), we need
to check that the service has the feature flag enabled first. This is
usually done by the caller, but template macro doesn't have access to
`current_service`. To avoid passing it in each time the macro is called
we're adding a temporary check inside the method itself.

This commit can be reverted completely when we remove the service
feature flag.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
e6d4c7aaa8 Don't link folders in the folder path if user doesn't have permission
This updates folder_path macro to not link to any folders that
the user doesn't have permission for.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
172f6b303f Fix missing New template / folder buttons on Templates root page
User folder permission check should recognize both `None` folder and
folder with a `None` id as template root.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
7e0529b600 Fix missing space in current_user context processor 2019-04-01 10:50:39 +01:00
Alexey Bezhan
364ed7d4c6 Add tests that user folder permission check is being called 2019-04-01 10:50:39 +01:00
Alexey Bezhan
355927d091 Hide template and folder action links if user doesn't have folder access
Hides action links ('Send', 'Edit', 'Delete' and 'Redact' fro templates
and 'Manage' for template folders) and buttons ('New template', 'New folder')
if the user doesn't have permission to view current folder or template's
parent folder.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
bfe6768796 Add user permission check to template folder actions 2019-04-01 10:50:38 +01:00
Alexey Bezhan
792b625de7 Add folder permission check to copy template endpoint
Copying a template from another service is one place where we can't
use the `current_service` method since the source template can belong
to a different service the user has access to, so we're using an API
client method.
2019-04-01 10:50:38 +01:00
Alexey Bezhan
35fb92c02c Replace sevice api client get template calls with Service methods
Instead of using the API client directly views are now calling one
of two Service model methods:

`get_template` is used for view actions, where the user should see
the template page even if they don't have access to the template
folder (since all templates are still inked from the dashboard or
the sent notifications pages).

`get_template_with_user_permission_or_403` will check if the user
has access to the template's folder first and return 403 otherwise.
This method is used for any endpoints that result in an action: editing
template attributes, deleting templates or sending messages.
2019-04-01 10:50:38 +01:00
Alexey Bezhan
a30c9733b0 Add a helper Service method to get a template given user has permission
Checks if the user has access to the template's parent folder and
either returns the template or a 403 response.

This method should be used instead of calling service_api_client from
the views.
2019-04-01 10:50:38 +01:00
Alexey Bezhan
af2eb0555d Make sure users always have permission to access top-level templates 2019-04-01 10:50:38 +01:00
Alexey Bezhan
e6d7f7ebeb Add a user method to check folder permission
User model is the most natural place for a permission check method,
however this means that we need to pass the full user object to
service model methods and TemplateList instead of user_id.
2019-04-01 10:50:38 +01:00
Chris Hill-Scott
0f9207a161 Merge pull request #2882 from alphagov/eaststaffsbc.gov.uk
Mark agreement signed by East Staffordshire
2019-04-01 10:25:17 +01:00
Chris Hill-Scott
2c03771e9c Mark agreement signed by East Staffordshire 2019-04-01 10:17:00 +01:00
Leo Hemsted
050a879ae1 Merge pull request #2881 from alphagov/make-inbound-search-post
make inbound search a POST
2019-03-29 15:59:01 +00:00
Leo Hemsted
53cdbad2cc make inbound search a POST
that way it doesn't expose PII to our logs
2019-03-29 15:16:29 +00:00
Tom Byers
c5208d712e Merge pull request #2876 from alphagov/stop-focus-overlap-alternative
Stop focus overlap - with support for caret focus
2019-03-27 14:54:09 +00:00
Chris Hill-Scott
a852b6ef07 Merge pull request #2879 from alphagov/use-client-request-fixture
Use `client_request` fixture where possible
2019-03-27 10:51:22 +00:00
karlchillmaid
151fa35e1e Merge pull request #2877 from alphagov/free-message-allowance-update
Update free text message allowance
2019-03-27 10:38:02 +00:00
Chris Hill-Scott
883b07e3f0 Use client_request fixture where possible
It:
- saves repetetive boilerplate code
- does some extra checks (eg checking for a `200` response)
- makes the codebase less confusing to consistently do the same thing in
  the same way
2019-03-26 16:38:00 +00:00
Leo Hemsted
6cf2b2531b Merge pull request #2866 from alphagov/edit-no-delete
fix user permissions save button sometimes deleting
2019-03-26 16:17:15 +00:00
Leo Hemsted
f872294235 remove the remove-user get method
remove `confirm` from `confirm_remove_user_from_service` as there's
only one action now that the initial confirmation prompt takes place
on the edit permissions page
2019-03-26 15:52:37 +00:00
Leo Hemsted
f7f9dd8530 fix user permissions save button sometimes deleting
when you hit the delete button, it flashes the delete button and takes
you to the `/service/../user/../delete` url. If you then click the save
button, it would make a POST to the delete URL... and delete the user.

now the page stays on the edit url, but adds a `?delete=yes` query
string. The dangerous flash banner now has an action field which
defines where the browser will make the POST to (which remains at
/delete).
2019-03-26 15:52:37 +00:00
Chris Hill-Scott
37d12d3aa3 Merge pull request #2878 from alphagov/angus.gov.uk
Mark agreement signed by Angus Council
2019-03-26 14:58:56 +00:00
Chris Hill-Scott
59311e5eab Mark agreement signed by Angus Council 2019-03-26 14:46:06 +00:00
karlchillmaid
67e176133b Updated free text message allowance
Updated free text message allowance to make it clearer.

Added a link to full pricing information.

Ticket: https://www.pivotaltracker.com/story/show/163908166
2019-03-26 10:59:27 +00:00
Chris Hill-Scott
d693715516 Merge pull request #2875 from alphagov/set-service-count-as-live
Allow excluding services from live services count
2019-03-25 16:26:34 +00:00
Tom Byers
a426cae968 Remove overlap check for elements in sticky
Our sticky controls often contain focusable
elements.
2019-03-25 15:59:32 +00:00
Tom Byers
8ad4c5e6e1 Add separate overlap handling for textareas
Our textareas are multi-line and can change in
size based on their content.

Because of this, we need to check the caret for
overlapping, not the whole textarea.

This adds separate tracking for this.
2019-03-25 15:59:32 +00:00
Tom Byers
d1c028e7d4 Add library for tracking carets in textareas 2019-03-25 15:58:23 +00:00
Tom Byers
5ba2bd66e0 Revert "Merge pull request #2855 from alphagov/revert-2843-stop-sticky-overlapping-focus"
This reverts commit 0f9969989a, reversing
changes made to 42e3770e65.
2019-03-25 15:58:23 +00:00
Chris Hill-Scott
8fb576e60a Allow excluding services from live services count
Adds a front end for:
https://github.com/alphagov/notifications-api/pull/2417

> Sometimes we have to make a few services for what really is one
> service, for example GOV.UK Pay and GOV.UK Pay Direct Debit. We also
> have our own test services which aren’t included in the count of live
> services. We currently count these as one service by not including
> them in the beta partners spreadsheet.
2019-03-25 15:46:35 +00:00
Chris Hill-Scott
ec876278ab Merge pull request #2874 from alphagov/sevenoaks.gov.uk
Mark agreement signed by Sevenoaks District Council
2019-03-25 14:33:08 +00:00
Chris Hill-Scott
0f4fcafe59 Mark agreement signed by Sevenoaks District Council 2019-03-25 14:24:46 +00:00
Chris Hill-Scott
9789727f95 Merge pull request #2872 from alphagov/no-pytest-4
Stop Pyup trying to upgrade us to Pytest 4
2019-03-25 13:48:45 +00:00
Chris Hill-Scott
8f7d18efb5 Stop Pyup trying to upgrade us to Pytest 4
There’s no point until we’ve changed our code to conform.
2019-03-25 12:04:42 +00:00
Chris Hill-Scott
0a4208ae36 Merge pull request #2870 from alphagov/pyup-update-isort-4.3.4-to-4.3.16
Update isort to 4.3.16
2019-03-25 11:38:27 +00:00
Rebecca Law
9bd642d2cf Merge pull request #2871 from alphagov/add-pyup-yml
Update pyup to run once a week.
2019-03-25 11:28:26 +00:00