summaryrefslogtreecommitdiffstats
path: root/app/user.go
Commit message (Collapse)AuthorAgeFilesLines
* Migrate to idiomatic error handling in app/user.go (#9711)Hanzei2018-10-221-346/+317
|
* MM-12234: configurable limit to user autocomplete and search matches (#9499)Jesse Hallam2018-10-171-29/+29
| | | | | | | | | | * unit test cleanup * allow limiting user search results * clean up test users before starting * model UserSearchOptions to simplify parameters
* Refactored to rename "service terms" to "terms of service" (#9581)Harshil Sharma2018-10-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #124 renamed identififers from service terms to terms of service * #124 renamed identififers from service terms to terms of service * 124 renamed ServiceTerms model to TermsOfService * 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService * 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService * #124 fixed formatting * #124 fixed formatting * #132 renamed table ServiceTerms to TermsOfService * #124 renamed some missed files from 'service_terms' to 'terms_of_service' * #124 removed fixed TODOs * drop migrate of ServiceTerms table, since backporting * s/ServiceTerms/TermsOfService/ in tests * s/AcceptedServiceTermsId/AcceptedTermsOfServiceId/ Change the model attribute, even though the column name will eventually be removed. * s/accepted_service_terms_id/accepted_terms_of_service_id/ to match redux * s/serviceTerms/termsOfService * rename column too, and add max size constraint * s/EnableCustomServiceTerms/EnableCustomTermsOfService
* MM-12067: Add SetDefaultProfileImage to reset the user profile image to a ↵Jesús Espino2018-10-021-20/+56
| | | | | | | | | | | | generated one (#9449) * MM-12067: Add SetDefaultProfileImage to reset the user profile image to a generated one * Allow to get the default profile image for my user * Allowing to reset the last update image date to 0 * PR reviews
* #MM-12130 changes for custom service terms (#9450)Harshil Sharma2018-09-261-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #MM-12130 changes for custom service terms * Fixed styling * Added getServiceTerms API * removed unnecessary panic * removed custom service terms text from flat config * reverted user sql store as those changes are no longer needed * added tests * Updated a config key to be more standard * Added copyright info * Loading service terms only if the feature is enabled * Loading service terms only if the feature is enabled * removed unused index * added createservice termns API * made a param to bool instead of string * added createservice termns API * review fixes * fixed styling * Minor refactoring * removed saveConfig and loadConfig magic * added empty service terms text check to createServiceTerms API * refactoed some urls to be terms_of_service instead of service_terms * removed check for support settings * changed URLs in tests * removed unused code * fixed a bug * added service termd id in conif * fixed a test * review fixes * minor fixes * Fixed TestCreateServiceTerms
* Stop re-wrapping password reset email error in another error (#9382)Harrison Healey2018-09-101-5/+1
|
* Pr 9039 (#9187)Martin Kraft2018-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-11065: Allow to search and get archived channels from the API * Fixing more tests * Add some unit tests * Add includeDeleted parameter to session permissions check function * More test fixing * Adding archive channels list in channels search * Add restriction for archived channel edition * Reverting permissions checks modification * Changed the query parameter to include_deleted * Enable search archive channels as true by default * Adding tests for verify search on deleted channels * Allowing to override archive channels during the imports * Fixed test * Search in archive channels from the API must be explicitly requested * Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam * Back to ViewArchivedChannels config * Fixing tests * Reverting GetChannelByName parameter * Add include deleted parameter on GetChannel functions in plugins api * Fixing tests
* Enhance Log Output from Permanent Delete (#9044)Daniel Schalla2018-07-121-5/+17
| | | | | | | use structured logging Missed Structured Log Using Err for Errors in Structured Logging
* MM-10766 - Replacing default profile image font (#8955)Asaad Mahmood2018-07-051-7/+18
| | | | | | | | | | | | * Updating default profile pic font * Updating profile image font * Updating test * Use new default font if configured for old one * Update OFL.txt
* Implementation of File Exists Function; Delete FileInfos upon Permanent User ↵Daniel Schalla2018-06-251-0/+27
| | | | | | | Delete (#8958) Check if file was deleted on FS Warning message if file couldnt be removed
* Relese5.0 merge master 20180608 (#8933)Carlos Tadeu Panato Junior2018-06-081-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add missing diagnostics (#8911) * Update diagnostics.go * Update diagnostics.go * Fix push notification styling backwards compatibility (#8913) * MM-10803: remove premature user sanitization on deactivation (#8926) * remove unused UpdateNonSSOUserActive * MM-10803: stop prematurely sanitizing users on deactivate This change was preceded by the removal of UpdateNonSSOUserActive to ensure there are no APIs relying on the sanitized return value. * MM-10803: test websocket events after UpdateUserActive * MM-10264: Adds system scheme to permissions import/export. (#8924) * MM-10264: Adds system scheme to permissions import/export. * MM-10264: Switches to more likely unique name. * MM-10264: Changed collision prevention string. * MM-10264: Rolls back created schemes in all error cases. * MM-10264: Test fix for more rollback cases.
* Get the count of the all system users at endpoint /users/stats (#8847)lisakycho2018-06-071-0/+11
| | | | | | | | * Get the count of the all system users at endpoint /users/stats * Added GetTotalUsersStats test in api4 * Changed pluralization and added the test back.
* MM-10640 Set EnableUserCreation to true by default (#8815)Balasankar C2018-05-181-2/+2
| | | | | | | | | | | | | | * Set EnableUserCreation to true by default * Fix argument type to FormatBool * Convert EnableUserCreation instances to pointer * Convert to boolean in tests also * Set value of pointer to be false * Convert remaining EnableUserCreation instances to pointer
* MM-10188: expect io.Reader in FileBackend.WriteFile (#8765)Jesse Hallam2018-05-101-2/+2
| | | | This is a reworked set of changes originally from @josephGuo to begin reducing the duplicated memory required when uploading files.
* MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID ↵Christopher Speller2018-05-101-32/+0
| | | | | | | | | | | | | | without losing their account (#8756) * Adding LoginIdAttribute * Modifying LDAP to use loginIDAttribute. * Adding IDAttribute migration and AD objectGUID support. * Removing unused idea. * Fix typo.
* Structured logging (#8673)Christopher Speller2018-04-271-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implementing structured logging * Changes to en.json to allow refactor to run. * Fixing global logger * Structured logger initalization. * Add caller. * Do some log redirection. * Auto refactor * Cleaning up l4g reference and removing dependancy. * Removing junk. * Copyright headers. * Fixing tests * Revert "Changes to en.json to allow refactor to run." This reverts commit fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable.
* MM-10007 Send an admin and regular WS events when a user is updated (#8588)Joram Wilander2018-04-201-1/+8
| | | | | | | | * Add user.DeepCopy() function * Add omit admins/non-admins to WS broadcast and use for updating users * Updates per feedback and adding unit test for ShouldSendEvent
* MM-9779: Incorporate a Token into the invitations system (#8604)Jesús Espino2018-04-181-10/+21
| | | | | | | | | | | | | | | | | | | | * Incorporate a Token into the invitations system * Adding unit tests * Fixing some api4 client tests * Removing unnecesary hash validation * Change the Hash concept on invitations with tokenId * Not send invitation if it wasn't able to create the Token * Fixing some naming problems * Changing the hash query params received from the client side * Removed unneded data param in the token usage
* add app shutdown to make sure the goroutines finish and all process are ↵Carlos Tadeu Panato Junior2018-04-171-3/+5
| | | | | | | | closed (#8629) * run the send email verification as goroutine as well * add app shutdown to make sure all go routines finish
* Fix sanitization on websocket user edit events. (#8551)Christopher Speller2018-03-291-5/+5
|
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Martin Kraft2018-03-271-0/+2
|\
| * send websocket event when users are activated / deactivated (#8500)Chris2018-03-231-0/+2
| |
* | Merge branch 'master' into advanced-permissions-phase-1Martin Kraft2018-03-231-1/+2
|\|
| * Fix various segfaults when running `go test` manually (#8448)Jesse Hallam2018-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * failing to find i18n shouldn't segfault The server was trying to handle the fact that it couldn't find the i18n directory, by emitting a translated log message... * fix utils.FindDir The attempts to find the directory in the parent or grandparent directory don't work if the current working directory was inside `enterprise`, with `enterprise` itself being a symlink as per the usual developer setup. Recurse to the root of the filesystem, cleaning the path along the way to work around this limitation (and allow tests to be run from an arbitrarily deep nesting level.) Fix corresponding usages to employ filepath.Join. * failing to find html templates shouldn't segfault * fail fast if the test user cannot be created * rework utils.FindDir to retain backwards compatibility
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-131-12/+19
|\|
| * Remove query to update channel extra_update_at field on user ↵Joram Wilander2018-03-091-4/+0
| | | | | | | | activation/deactivation (#8415)
| * MM-9274- Sort Users in Channel by status (#8181)Stephen Kiers2018-03-091-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * reverse dnd and offline * Fixed app.SaveStatusAndBroadcast * Fixed incorrect merge * Fixing incorrect merge again
| * general cleanup (#8387)Chris2018-03-071-1/+0
| |
| * remove `go Publish(...)` idiom (#8373)Chris2018-03-021-7/+2
| |
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-021-9/+9
|\|
| * Remove global site url (#8343)Chris2018-02-221-9/+9
| | | | | | | | | | | | | | | | * remove global site url * missed one * revert mysterious change
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Jesús Espino2018-02-071-1/+2
|\|
| * add App.License, remove utils.IsLicensed / utils.License calls (#8203)Chris2018-02-061-1/+2
| |
* | XYZ-37: Advanced Permissions Phase 1 Backend. (#8159)George Goldberg2018-02-061-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | * XYZ-13: Update Permission and Role structs to new design. * XYZ-10: Role store. * XYZ-9/XYZ-44: Roles API endpoints and WebSocket message. * XYZ-8: Switch server permissions checks to store backed roles. * XYZ-58: Proper validation of roles where required. * XYZ-11/XYZ-55: Migration to store backed roles from policy config. * XYZ-37: Update unit tests to work with database roles. * XYZ-56: Remove the "guest" role. * Changes to SetDefaultRolesFromConfig. * Short-circuit the store if nothing has changed. * Address first round of review comments. * Address second round of review comments.
* [XYZ-6] Add sampledata platform command (#8027)Jesús Espino2018-01-111-0/+3
| | | | | | | | * Add fake dependency * [XYZ-6] Add sampledata platform command * Creating EMOJI_NAME_MAX_LENGTH as a constant and using it where needed
* Add admin update endpoint that can update authservice and authdata (#7842)Chris Duarte2018-01-041-0/+24
| | | | | | | | | | * add admin update endpoint that can upate authservice and authdata * Control only SystemAdmin access * Refactored AdminUpdate endpoint to only be able to update AuthData, AuthService and Password by User.Id * Refactor to move `PUT /api/v4/users/{user_id}/auth`. Created a struct to hold UserAuth info.
* Don't omit current user from updated user WS event (#8018)Joram Wilander2018-01-021-3/+1
|
* Role refactor (#7867)Chris2017-11-211-3/+3
| | | | | | | | * role refactor * add missing file * fix web test
* refactor template code (#7860)Chris2017-11-201-2/+2
|
* Include current user in WebSocket update event when setting profile image ↵Joram Wilander2017-11-201-3/+1
| | | | (#7862)
* Refactor password validation and config defaults (#7859)Chris2017-11-201-2/+2
| | | | | | * refactor password validation and config defaults * reorder config lines for clarity
* Reorganize file util functionality (#7848)Chris2017-11-161-3/+3
| | | | | | | | * reorganize file util functionality * fix api test compilation * fix rebase issue
* Merge branch 'release-4.4'Christopher Speller2017-11-091-0/+6
|\
| * PLT-8061 re-activate SAML and Oauth on successful login (#7810)Corey Hulen2017-11-091-0/+6
| |
* | more global config ref cleanup (#7802)Chris2017-11-091-1/+1
|/
* prevent users from changing email addresses to restricted domains (#7765)Chris2017-11-031-0/+11
|
* several one-line panic, race, and logic fixes (#7766)Chris2017-11-031-1/+1
|
* prevent deactivation of sso users (#7759)Chris2017-11-021-3/+3
|
* PLT-7978 Add websocket event for user role update (#7745)Joram Wilander2017-10-311-1/+8
| | | | | | | | * Add websocket event for user role update * Fix tests * More test fixes
* Refactoring cfg refs and load / save functions (#7749)Chris2017-10-311-35/+35
| | | | | | * refactoring cfg refs and load / save functions * improve error output