Commit Graph

3 Commits

Author SHA1 Message Date
Katie Smith
bef24408d0 Add DAO function to archive a user
For a user to be able to be archived, each service that they are a
member of must have at least one other user who is active and who has
the 'manage-settings' permission.

To archive a user we remove them from all their services and
organisations, remove all permissions that they have and change some of
their details:
- email_address will start with '_archived_<date>'
- the current_session_id is changed (to sign them out of their current
session)
- mobile_number is removed (so we also need to switch their auth type to
email_auth)
- password is changed to a random password
- state is changed to 'inactive'

If any of the steps fail, we rollback all changes.
2019-06-05 14:54:52 +01:00
Pea Tyczynska
64c0c19419 Set user permissions when creating a folder
If the new folder has a parent folder, it inherits user permissions
from its parent. Else if the new folder is at root level, all users
will have a permission to view it.
2019-03-12 16:11:20 +00:00
Katie Smith
d981abf18e Allow user folder permissions to be updated
Updated the endpoint for `.set_permissions` to update a user's folder
permissions as well as permissions for a service. User folder
permissions are optional for now, since Admin is not currently passing
this data through.
2019-02-27 12:56:26 +00:00