Commit Graph

17 Commits

Author SHA1 Message Date
Cody Cutrer 4d43809cae RuboCop: Style/PercentLiteralDelimiters
[skip-stages=Flakey]

auto-corrected, with a post-review looking for multiline strings
to convert to heredocs

Change-Id: I7f7afb11edd63415cde10866822dd2ac5ba0d8be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278669
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:05:50 +00:00
Cody Cutrer e0c69c330e RuboCop: Rails/Pluck
[skip-stages=Flakey]

auto-corrected

Change-Id: Iaad8a0eeece0bb57dae8f274ce4b98766b6f0261
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278362
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-17 20:00:28 +00:00
Cody Cutrer 58eb4175fb RuboCop: Performance/MapCompact
[skip-stages=Flakey]

auto-corrected

Change-Id: I9e768e051924cfe58bf282f85d3cf6ca48735e9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278264
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:20:07 +00:00
Cody Cutrer 61e5b3a6dc RuboCop: Lint/UnusedMethodArgument lib
all manual

Change-Id: I0db0dbf9ffec3ac6675f6d159f8d038fe2f09256
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:54:27 +00:00
Cody Cutrer 58d528037e RuboCop: Lint/AssignmentInCondition
[skip-stages=Flakey]

(manual)

Change-Id: I855b13a7888f4926df42fe6306cc248e611efdf6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274712
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:39 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:23 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Cody Cutrer 2a68e3a8bc hidden feature flag to allow unconfirmed emails when adding users
partially reverts 05ab511b97

fixes FOO-2069

Change-Id: Ia97bf9e3c204874053f7c8dcaed9c613a146b530
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266837
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-06-14 14:55:34 +00:00
Cody Cutrer 05ab511b97 ignore unconfirmed communication channels when adding users
fixes FOO-1898

[ignore-stage-results=Flakey Spec Catcher]
this commit touches known flakey specs,
but does not make them any flakier

if they have open registration off, we need to trust the SIS
if open registration is on, we ignore unconfirmed anyway, and
just create a new temp user that will get merged together

test plan:
 * have open registration *off*
 * add two users with confirmed email addresses (via SIS, etc.)
 * log in as one of the users, and go to your profile
 * add the other user's e-mail address (but don't confirm it,
   since in reality you couldn't)
 * log in as a teacher or an admin
 * add a student to a course with the duplicated email
 * it should only find the confirmed user
 * add the user as an admin
 * same result

Change-Id: I0a64c45876d7f49e3662f55496e76c5c37306376
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265171
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-05-26 16:11:59 +00:00
Ethan Vizitei 8a7082c8dd provide reasonable user output for search violation
closes FOO-1383
flag=none

TEST PLAN:
  1) try to use a seach_type of "nonsense"
  2) you get a 400, not a 500

Change-Id: I901ded4c2cbc1106f322ca9ee8bbe389131162b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255697
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-01-04 17:13:53 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:49:50 +00:00
Jeremy Stanley c94b159f09 use opaque tokens rather than ids to mass-enroll users
make user_lists v2 and invite_users return a `user_token`
in addition to id, and make enroll_users accept an array
of these instead of ids

test plan:
 - regression test the "+ People" functionality on the
   course People page
   - using each way to find people
   - when finding existing users and creating new users
   - when finding a user in another shard

fixes ADMIN-265

Change-Id: I792a50d2d9504d13471794889708a69d11144fdd
Reviewed-on: https://gerrit.instructure.com/131933
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-11-08 20:29:07 +00:00
Cody Cutrer bd7f480b63 find the correct pseudonym in UserListV2 when search by cc
fixes CNVS-38767

test plan:
 * in a group of associated accounts, each on different shards
 * create a user in one shard/school (A)
 * add a login for that user to a school (B) on a different shard
   (preferably with a different login ID than their login to
    school A)
 * in school B, go to add a user to a course, and search by
   the user's e-mail address
 * it should find the user, and show their login and institution
   as being school B
 * if you search by login ID instead, and search for their school
   A login ID, it will show they're from school A

Change-Id: I60e0d204169ba42c7a6dd3d5dad5080c269809f7
Reviewed-on: https://gerrit.instructure.com/123385
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-08-29 00:31:40 +00:00
Cody Cutrer 99f5b454ed refactor and unify User#find_pseudonym_for_account and SisPseudonym
fixes CNVS-35919

also, prefer SIS pseudonyms over non-SIS pseudonyms from any given
account

test plan:
 * have a non-SIS pseudonym and a SIS pseudonym on a user
 * do an LTI launch
 * the LTI tool should get the info from the SIS pseudonym

Change-Id: I60a3c48a32eae94db93b0e72f1f0f6c5b6a5f5c2
Reviewed-on: https://gerrit.instructure.com/107785
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
2017-05-02 18:50:31 +00:00
Landon Wilkins 45b8efda41 da licença part 36
add consistent license headers to all source files

Change-Id: I15e544768e7361fc050089a5ed4699f7ee96bb2c
Reviewed-on: https://gerrit.instructure.com/110064
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 17:31:17 +00:00
James Williams 32a274ec86 fix course new user search with duplicate results for same user
fixes a problem caused by two matching cross-shard
communication channels that happen to belong to the
same user. it tricked the code into thinking there
was a duplicate result but then broken when trying
to find the "other" user

closes #CNVS-35649

Change-Id: I61c555ce563a684d9579747a38a9758515bdbb1a
Reviewed-on: https://gerrit.instructure.com/105155
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-03-15 16:40:51 +00:00
James Williams 91e416a85c user lists v2
doesn't worry about the creation of users, only returns
whether the users are found or not and whether there
are multiple matches across the trusted accounts
(doesn't try to prioritize one or the other, instead letting
 the user decide which user to add)

also only uses one search method so it's more explicit how
we're trying to find users

how to use:
similar to current user list,
post to /courses/X/user_lists.json
with a 'user_list' text parameter
but add additional parameters
 - 'v2' set to 1 or true
 - 'search_type' set to either
 'unique_id' (login ID)
 'sis_user_id' (also searches integration id because why not)
 'cc_type' (searches email addresses and sms phone numbers)

closes #CNVS-32175

Change-Id: I175e49a93525674ae97a067b9e8443812fa964f0
Reviewed-on: https://gerrit.instructure.com/91430
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-11-15 13:56:03 +00:00