summaryrefslogtreecommitdiffstats
path: root/api4/channel_test.go
Commit message (Collapse)AuthorAgeFilesLines
* [APIv4] add getChannelMembersTimezone (#9286)Carlos Tadeu Panato Junior2018-10-131-0/+49
| | | | | | | | * add getChannelMembersTimezone * update per feedback review * add delimeter to error
* MM-11567: Autocomplete search in: for DMs and GMs (#9430)Jesús Espino2018-09-271-6/+131
| | | | | | | | | | * MM-11567: Autocomplete search in: for DMs and GMs * Adding unit tests * Allowing to search Direct Messages in the autocompletion * Fix it in TE
* add megacheck as makefile target (#9288)Daniel Schalla2018-09-031-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Fix code issues in channel_test.go Fix Channel Test Issues detected by Megacheck Fix API Emoji Test Issues detected by Megacheck Fixed API Issues Reported by Megacheck Fixed App issues reported by megacheck Remaining fixes removed test added by mistake from old HEAD gofmt Store Fixes simplified returns Fix test for multi member channel delete revert to delete unused function
* [MM-11593] Prevent user to remove from a direct channel (#9251)Saturnino Abril2018-08-211-0/+24
| | | | | | * prevent user to remove from a direct channel * only allow removing of a member in private or public channel
* MM-11576: Allow to join and add members to archived channels (#9214)Jesús Espino2018-08-031-2/+0
|
* MM-11529: Allow to Leave an archived channel from the API (#9204)Jesús Espino2018-08-031-0/+12
| | | | | | * MM-11529: Allow to Leave an archived channel from the API * Remove the restriction to remove user from archive channel to yourself
* Pr 9039 (#9187)Martin Kraft2018-07-301-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Merge branch 'plugins-2'JoramWilander2018-07-101-3/+0
|\
| * Merge branch 'master' into plugins-2JoramWilander2018-07-071-0/+38
| |\
| * | First batch of new plugin api methods (#9022)Daniel Schalla2018-07-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | update api mocks Generated new hooks ChannelHasJoinedChannel Implementation User Left Team/Channel Hook; User Joined Team Hook Implementation Update RPC Client and Mocks gofmt go tests fix Add Config API Methods codegne Add Channel Has Been Created Hook Fix ChannelHasBeenCreated hook fix missing context param fix duplicate hooks; remove redudandcy
* | | MM-11228: Fix channel update/patch API endpoints. (#9073)George Goldberg2018-07-101-1/+57
| |/ |/|
* | MM-11118: disallow deleting direct or group channels (#9054)Jesse Hallam2018-07-051-0/+38
|/
* MM-9730 & MM-9729: Missing Server PRs (#8908)George Goldberg2018-06-051-0/+76
| | | | | | * MM-9730: API endpoint to update scheme-derived roles of TeamMembers. * MM-9729: API to update scheme-derived roles of ChannelMembers.
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-281-0/+31
|\
| * [MM-10519] Send websocket event whenever the channel has changed it's type ↵Saturnino Abril2018-05-281-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (public|private) (#8798) * send websocket event whenever the channel has changed it's type (public|private) * updated per comment Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com> * add channel_converted websocket event Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com> * only send channel_id via websocket message for "channel_converted" event Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
* | Refactors migrations check. (#8814)Martin Kraft2018-05-211-12/+1
| |
* | MM-10264: Adds CLI command to import and export permissions. (#8787)Martin Kraft2018-05-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-10264: Adds CLI command to import and export permissions. * MM-10264: Changes Scheme Name to DisplayName and adds Name slug field. * MM-10264: Changes display name max size. * MM-10264: Another merge fix. * MM-10264: Changes for more Schemes methods checking for migration. * MM-10264: More updates for Schemes migration checking.
* | MM-9728: Online migration for advanced permissions phase 2 (#8744)George Goldberg2018-05-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9728: Online migration for advanced permissions phase 2 * Add unit tests for new store functions. * Move migration specific code to own file. * Add migration state function test. * Style fixes. * Add i18n strings. * Fix mocks. * Add TestMain to migrations package tests. * Fix typo. * Fix review comments. * Fix up the "Check if migration is done" check to actually work.
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-091-4/+8
|\|
| * update permission of converting a channel from public to private to allow ↵Saturnino Abril2018-05-051-4/+8
| | | | | | | | team admin (#8723)
* | MM-10182 & MM-10183: Adds channel scheme and team scheme API endpoint. (#8680)Martin Kraft2018-05-021-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | * MM-10183: Adds channel scheme API endpoint. MM-10182: Adds team scheme API endpoint. MM-10182_3: Switch from scheme_id in path to body. * MM-10182/MM-10183: Changes path from 'schemes' to 'scheme'. * MM-10182: Fix merge error.
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-04-241-0/+40
|\|
| * add api to convert a channel from public to private and restrict that to ↵Saturnino Abril2018-04-231-0/+40
| | | | | | | | system_admin (#8655)
* | MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)George Goldberg2018-04-201-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Scheme model and stub store. * Port ChannelStore to be Scheme aware. * Make almost all the API/APP layer work with ChannelSchemes. Only thing still hacky is UpdateChannelMemberRoles(). * Add basic SchemeStore implementation. * Migrate UpdateChannelMemberRoles properly and fix tests. * Update store tests and mocks so they work. * Include creating default roles in Scheme create store function. * Implement role deletion and start scheme deletion. * Only use non-deleted roles for authorization. * Add GetByScheme method to Team store. * Add GetChannelsByScheme. * Update store mocks. * Implement scheme deletion in the store. * Rename is valid function. * Add offset and limit to queries to fetch teams and channels by scheme. * Fix queries. * Implement scheme awareness in Team store and add a migration. * Tidy up ChannelStore mapping functions and add exhaustive unit tests. * Add all missing i18n. * Proper tests for TeamStore internal functions and fix them. * Make additional TeamMember fields nullable. * Make new ChannelMember fields nullable. * Create new nullable columns without defaults. * Make new fields in large tables nullalble. * Fix empty list of TeamMembers. * Deduplicate SQL queries. * Fix spelling. * Fix review comment. * More review fixes. * More review fixes.
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Martin Kraft2018-03-271-0/+73
|\
| * Adding go client support and basic unit tests for channel autocomplete. (#8510)Christopher Speller2018-03-261-0/+73
| |
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-131-2/+1
|\|
| * MM-9664 Add invalidation metrics for store caches (#8340)Joram Wilander2018-03-051-4/+3
| | | | | | | | | | | | | | | | * Add invalidation metrics for store caches * Increment session invalidation metric * Fix tests
| * Eliminate utils.SetLicense calls (#8217)Chris2018-02-071-135/+13
| | | | | | | | | | | | | | | | | | | | * eliminate utils.SetLicense calls * test fix * another test fix * more test fixes
* | MM-9618: Don't change default role permissions for policy. (#8303)George Goldberg2018-02-191-4/+4
| |
* | Fix tests. (#8244)George Goldberg2018-02-121-8/+0
| |
* | XYZ-37: Advanced Permissions Phase 1 Backend. (#8159)George Goldberg2018-02-061-407/+44
|/ | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* [PLT-8430] Auto lowercase team and channel names in API requests (#7992)Carlos Tadeu Panato Junior2018-01-121-0/+4
|
* Role refactor (#7867)Chris2017-11-211-24/+24
| | | | | | | | * role refactor * add missing file * fix web test
* [PLT-7362] Add post' root ID to APIv4 addChannelMember to render added user ↵Saturnino Abril2017-10-311-0/+18
| | | | | | | | | | (as system post) at RHS (#7730) * add post' root ID to apiv4 addChannelMember to render added user (as system post) at RHS * add check to post_root_id parameter * add AddChannelMemberWithRootId function for backward compatibility
* Reduce utils.Cfg references (#7650)Chris2017-10-181-36/+76
| | | | | | | | | | | | * app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp
* PLT-7718 Patch for files (#7564)Joram Wilander2017-10-041-1/+1
| | | | | | | | | | * Patch for files * Fix merge * Fix tests * Fix another test
* Don't use global app for api / api4 tests (#7528)Chris2017-10-021-43/+43
| | | | | | | | | | | | | | * don't use global app for api / api4 tests * put sleep back. we're gonna have to do some goroutine wrangling * fix oauth test config assumptions * jobs package, i'm comin' for you next * app test fix * try increasing sleep a little
* PLT-7404 Return viewed at times in view channel API response (#7428)Joram Wilander2017-09-291-3/+9
| | | | | | | | * Return viewed at times in view channel API response * Updated transaction to read and write once * Remove transaction and only update if new value greater than older
* Move sql store code into store/sqlstore package (#7502)Chris2017-09-251-4/+4
| | | | | | | | | | * move sql store code into store/sqlstore package * move non-sql constants back up to store * fix api test * derp
* fix plugin test (#7436)Chris2017-09-121-1/+2
| | | | | | | | | | | | * fix plugin test * ugh. global state * Fix plugin test * Fix TestDeleteChannel * Remove plugin config listener when shutting down
* Renaming repoChristopher Speller2017-09-061-3/+3
|
* app type transition (#7167)Chris2017-09-061-35/+34
|
* PLT-3893: Structured Logging Continues (#7252)Jonathan2017-08-311-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PLT-3893: Imported logger work from https://github.com/MusikPolice/platform * PLT-3893: Integrated logger with system config * PLT-3893: Integrated Mattermost config with logging solution, modified log message serialization so entire message is serialized as a JSON object * PLT-3893: Added support for format strings in Debug methods. Added an overload that does not require a Context object for cases when one isn't available * PLT-3893: Added context and format string support to debug and error methods * PLT-3893: A few updates from pull request feedback * PLT-3893: Changed tests to use testify * Fixed TestAddRemoveConfigListener to no longer assume that there are zero config listeners when the test begins, since other tests could add config listeners * Updated TestGetDeletedChannelsForTeam so that it doesn't assume state when it begins * PLT-3893: Changed File property of log message so that it's relative to /mattermost directory, rather than to wherever the user is running the application from on their machine * Flipped expected/actual assert arguments, added an explicit test for getCallerFilename(...), since it's failing on Jenkins * Added printlns to debug failing tests on Jenkins * Relaxed test cases to avoid failure on Jenkins caused by code coverage calculations. Removed printlns. * Changed the way that caller filename is determined to make it more robust, updated tests to make them more lax, while not choking on the strange paths that Jenkins uses. * Fixed gofmt issues * Added debug output to tests to diagnose Jenkins build failures * Still trying to get some useful debug logging on Jenkins * Changed getCallerFilename to handle the strange paths that runtime.Caller(...) returns on Jenkins * Fixing checkstyle issues
* PLT-6226 Fixing races with licensing (#7213)Corey Hulen2017-08-161-72/+72
| | | | | | | | | | * PLT-6226 Fixing races with licensing * Fixing build issue * Fixing licensing issue * removing commented code
* PLT-7206: Remove the "Delete Channel" option for private channels if you're ↵Jonathan2017-08-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | the last channel member and policy setting restricts channel deletion (#7050) * PLT-7206: UI changes. Removed last user in channel loophole, refactored code to clean it up, added differentiated support for public and private channels, added unit tests. Still need to implement server-side checks * PLT-7206: All helper methods in channel_utils.jsx now accept the same three boolean variables in the same order and use the same boolean logic to check their values. * PLT-7206: Added unit tests for showManagementOptions(...) * PLT-7206: Fixed test case descriptions * Added unit tests for showCreateOption(...) * PLT-7206: Added unit tests for canManageMembers(...) * PLT-7206: Removed last person in channel loophole from server-side code * PLT-7206: Reverted config.json * PLT-7206: Fixed double negatives in unit test names * PLT-7206: PR feedback - Removed confusing comment and unused variable
* [PLT-6838] Restrict channel delete option per permission policy even for ↵Saturnino Abril2017-07-051-3/+11
| | | | | | | | | | last channel member (#6706) * channel delete option is hidden from the menu unless there is appropriate permissions as set in the policy page * apply to public channel only and add restriction to API layer * updated channel deletion
* Move remaining actions over to use redux and v4 endpoints (#6720)Joram Wilander2017-06-261-2/+2
|
* PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263)Robin Naundorf2017-05-151-0/+26
|
* Merge branch 'release-3.9' into merge-3.9JoramWilander2017-05-121-0/+10
|\