Commit Graph

7475 Commits

Author SHA1 Message Date
karlchillmaid
a72a422b4f Updated introduction
Updated introduction to explain that users can set up multiple services in their account.
2019-04-11 10:31:17 +01:00
Katie Smith
55eaa066f1 Merge pull request #2892 from alphagov/add-audit-events
Add audit event when a service manager changes someones profile
2019-04-10 11:00:17 +01:00
Katie Smith
19fe587640 Make InvitedUser class always expect folder_permissions to be returned
InvitedUsers now always have folder_permissions (if they can't view any
folders their folder permissions will be `[]`).
2019-04-09 14:37:37 +01:00
Katie Smith
88e9a0ff61 Add audit event when a service manager changes someones profile
We should audit when a service manager changes a user profile that is not
their own. This can be recorded in our events table, which is currently
only used to record successful logins.

This adds two new types of event, `update_user_email` and
`update_user_mobile_number` which store the
- browser fingerprint
- IP address
- user id of the user being updated
- user id of the service manager  making the change
- original email address and new email address (for `update_user_email`
events)
- original mobile number and new mobile number (for
`update_user_mobile_number` events)
2019-04-09 14:37:37 +01:00
Leo Hemsted
a249382e69 Merge pull request #2898 from alphagov/user-permission-count
add count of folders visible per user to the team members page
2019-04-05 14:20:52 +01:00
Chris Hill-Scott
04c0b5cd4b Merge pull request #2900 from alphagov/cefas.co.uk
Let Centre for Environment Fisheries and Aquaculture Science sign up for Notify
2019-04-05 11:58:31 +01:00
Chris Hill-Scott
e56aeaefda Merge pull request #2899 from alphagov/update-service-count
Updated service and org counts
2019-04-05 11:48:20 +01:00
Chris Hill-Scott
86c15771e0 Let Centre for Environment Fisheries and Aquaculture Science sign up for Notify 2019-04-05 11:46:59 +01:00
Pete Herlihy
23b3710875 Updated service and org counts 2019-04-05 10:29:57 +01:00
Leo Hemsted
249b80762a add count of folders visible per user to the team members page
Shows a count of how many folders that user can see - this doesn't do
anything smart with parent folder stuff, it's just "how many checkboxes
are ticked on the edit page".

* doesn't show if service has no folders
* doesn't show if service hasn't got folder permissions enabled
2019-04-04 17:55:37 +01:00
Leo Hemsted
16d1526c46 bump utils to 31.2.4
brings in dev logging filter
2019-04-04 14:05:15 +01:00
Tom Byers
eb8a856c10 Merge pull request #2880 from alphagov/add-logic-to-autofocus
Prevent autofocus when page has scrolled
2019-04-03 15:37:25 +01:00
Chris Hill-Scott
79eb7d0f45 Merge pull request #2894 from alphagov/fix.lancaster.gov.uk
Fix name of Lancaster City Council
2019-04-03 14:50:27 +01:00
Tom Byers
cf07579a6b Correct name of forceFocus data attribute
Data attributes need to be '-' separated strings
in the HTML to appear as camelCase keys in the
`.dataset` (`.data()` in jQuery) property.

This corrects the assumption that the camelCasing
would carry through from the HTML.

More info:

https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
2019-04-03 14:41:09 +01:00
Tom Byers
cb55fbb344 Fix reference to non-existent jQuery collection
Raised on PR as comment:

e4b4be9d45 (r270781103)
2019-04-03 14:41:09 +01:00
Tom Byers
8d5e7e70ab Prevent autofocus when page has scrolled
If users scroll a page with an autofocus component
on so it is off-screen it seems safe to assume
they won't want it focused if they return to it.

This prevents that happening.

This adds a data-attribute flag to allow this
behaviour to be overridden.

We have some situations where the assumption here
isn't appropriate, for example on pages where the
component with autofocus is in a sticky element.
This means it will appear offscreen when the page
loads but, when its parent becomes sticky, will be
visible again.
2019-04-03 14:41:09 +01:00
Chris Hill-Scott
9619c64cb3 Fix name of Lancaster City Council
The county council is _Lancashire_
2019-04-03 14:25:50 +01:00
Leo Hemsted
1984128d1f Merge pull request #2893 from alphagov/copy-service-folder
fix bug with copying template from folder in other service
2019-04-03 14:13:27 +01:00
Chris Hill-Scott
a754eca29f Merge pull request #2886 from alphagov/hint-current-email-branding
Say what the current email branding is
2019-04-03 14:05:54 +01:00
Leo Hemsted
3e3c11f3a0 fix bug with copying template from folder in other service 2019-04-03 13:59:44 +01:00
Chris Hill-Scott
c2367010c4 Merge pull request #2891 from alphagov/dorsetcouncil.gov.uk
Add alternate domain for Dorset Council
2019-04-03 13:25:10 +01:00
Chris Hill-Scott
d749586f25 Add alternate domain for Dorset Council 2019-04-03 13:13:47 +01:00
Chris Hill-Scott
b1b496ba56 Say what the current email branding is
We keep getting people requesting branding when they already have the
branding they want set. Seems like they don’t realise we’re doing it
automatically. This might help.
2019-04-03 11:54:33 +01:00
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