canvas-lms/lib
Evan Battaglia df0dbfd8a3 CMC LTI all_tools_for III: replace to_a usages
Also fixes I mistake I made earlier causing all_tools for to return
tools from the parent if the child is in the same shard. (Associated MRA
commit fixes the spec which meant to test that case.)

closes INTEROP-7641
flag=lti_tools_from_federated_parents

Test plan:
- To test some module page placements, you will need the following flag
  on. Enable it on root accounts in both shards.
    Account.root_accounts.active.each{|a| a.enable_feature! :commons_favorites}
- Create LTI tools with the following placements:
   - course_home_sub_navigation
   - course_settings_sub_navigation
   - module_index_menu (or other placement in context_modules_controller:149)
   - module_menu_modal (or other placement in context_modules_controller:153)
   - conference_selection
  Create two differently-named tools in the CMC parent, and a tool in
  the CMC child and cross-shard child. The tools in the child should
  come alphabetically between the tools in the parent, e.g. in the
  parent call them "A" and "C" and in each child call it "B"
- First, go to create an assignment in a course in the SAME-SHARD CMC
  child. Choose "External Tool" as the submission type and check that
  only the tool in the child account shows up.
- Now, go check the placements mentioned above and check the following:
  - In the parent account, tools A and C should show up and launch
    successfully
  - In each of the children accounts, tools A, B, and C should show up
    in alphabetical order. Tool B should launch successfully. Tools A
    and C should have the same structure (e.g. link or URL when
    launched) as B but should have global IDs wherever B has a local id,
    if on the cross-shard child. Tools A and C probably won't launch yet.
- The placements can be checked as follows:
  course_home_sub_navigation: Go to the course page homepage, look on
    the right side
  course_settings_sub_navigation - Go to the course settings page, look
    on the right side
  module_index_menu -- course modules page, 3-dot dropdown on the top of
    the page before any modules, next to "+ Module" button
  module_menu_modal -- course modules page, 3-dot dropdown on
    the right side of the title bar for a module the module
  conference_selection -- I honestly couldn't figure out how to enable
    web conferencing for an account, so I just checked that
    WebConference.lti_tools(course) returned all the tools
- Change the settings of one of the tools so that one placement's
  visiblity (one that can be seen by non-admins, too, like
  course_home_sub_navigation) is "admins". Make sure to tools still
  shows up for admin, then masquerade as a student
  in the course and make sure that tool does not show up.

Change-Id: Ib03d3df7dcf4ba171b5484becdb65ebfcc4e56b3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300924
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2022-09-21 21:13:28 +00:00
..
address_book RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
api render peer review list in student assignment view 2022-09-15 15:18:14 +00:00
app_center RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
authentication_methods move inst_access to gem 2021-11-05 19:47:46 +00:00
base Safer jobs moves 2022-09-01 19:29:17 +00:00
basic_lti Log all bad requests to datadog 2022-07-27 18:11:49 +00:00
canvadocs RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
canvas include assignment.points_possible in quiz_export_complete event 2022-09-02 15:35:24 +00:00
cc scheduled publication of pages 2022-08-30 16:10:55 +00:00
cdc_migration_testing RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
data_fixup Add rcs_host custom field on Quiz LTI tools 2022-09-05 11:16:36 +00:00
external_auth_observation external auth observation zeitwerk compatibility 2021-10-07 22:35:20 +00:00
feature_flags remove enable_at / pending_enforcement from feature_flags 2022-05-19 01:30:59 +00:00
global_lookups make globalLookups a module to extend, not a stub 2021-10-26 14:58:27 +00:00
gradebook Apply score to ungraded with old and new gb filters 2022-03-11 20:05:29 +00:00
latex RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
lti CMC LTI all_tools_for III: replace to_a usages 2022-09-21 21:13:28 +00:00
messageable_user Prevent students from sending messages to concluded teacher 2022-07-01 14:31:00 +00:00
microsoft_sync Refresh MS Sync user mappings after email changes 2022-07-18 19:53:35 +00:00
migration_helpers RuboCop: Style/HashSyntax 2021-11-25 14:02:35 +00:00
outcomes Fetch OS results for sLMGB/LMGB 2022-09-13 17:00:05 +00:00
rake RuboCop: Style/SignalException 2021-11-19 22:24:25 +00:00
reporting RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
schemas support new module_menu_modal placement 2022-04-11 21:11:32 +00:00
sentry_extensions Add "db." prefix for ActiveRecord Sentry traces 2022-03-25 12:44:49 +00:00
services Allow Plagiarism tools without live events 2022-05-18 21:47:02 +00:00
sis expand sis hook method 2022-08-31 20:24:12 +00:00
support_helpers RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
tasks Fix yarn install error with @canvas/engine 2022-07-15 14:51:56 +00:00
turnitin Show error if we can't fetch TII submission 2022-05-20 17:04:35 +00:00
user_content RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
utils fix extra spaces in time strings 2022-04-05 19:10:26 +00:00
account_services.rb Remove Twitter from Canvas due to expired Key 2022-05-18 19:01:26 +00:00
address_book.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
anonymity.rb RuboCop: Style/RedundantSelf 2021-11-20 16:41:21 +00:00
api.rb compute total entries for UI course/user api index 2022-06-28 15:36:03 +00:00
api_route_set.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
asset_signature.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
assignment_override_applicator.rb remove flag prioritize_individual_overrides 2022-08-17 18:06:37 +00:00
assignment_util.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
authentication_methods.rb allow for request short-circuiting based on auth 2022-05-11 22:34:47 +00:00
basic_lti.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
brand_account_chain_resolver.rb favor active sub-account for branding 2021-12-08 18:15:55 +00:00
brand_config_helpers.rb Don't include parents in chain for regular accounts 2022-04-14 16:56:51 +00:00
brand_config_regenerator.rb Fix recursive brand config regeneration for subaccounts 2022-06-09 17:14:47 +00:00
brandable_css.rb give specific directions for running brandable_css 2022-08-25 17:07:08 +00:00
browser_support.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
canvadocs.rb Handle 503s and 504s from Canvadocs better 2022-05-11 16:25:06 +00:00
canvas_logger.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
cc.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
content_licenses.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
content_notices.rb RuboCop: Style/SymbolArray, Style/WordArray 2021-11-23 14:30:08 +00:00
content_zipper.rb include referenced hidden files in offline web exports 2022-05-06 16:50:01 +00:00
conversation_batch_scrubber.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
conversation_helper.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
copy_authorized_links.rb RuboCop: Style/IfInsideElse, Style/SoleNestedConditional 2021-11-23 14:28:35 +00:00
course_link_validator.rb Fix joinining on nil in valid_route? 2021-12-16 19:50:55 +00:00
course_pace_due_dates_calculator.rb Use calendar event blackout dates in due date calculations 2022-08-10 18:58:39 +00:00
course_pace_hard_end_date_compressor.rb Use compressor in publish 2022-08-25 22:33:09 +00:00
course_paces_date_helpers.rb Use calendar event blackout dates in due date calculations 2022-08-10 18:58:39 +00:00
custom_validations.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
cuty_capt.rb rename Canvas::DynamicSettings => DynamicSettings 2022-01-12 21:54:51 +00:00
dates_overridable.rb Remove points display for ungraded surveys 2022-02-16 16:47:44 +00:00
delayed_message_scrubber.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
delicious.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
differentiable_assignment.rb add granular permissions for managing course content 2022-04-11 20:53:27 +00:00
due_date_cacher.rb fix re-added students quiz submission workflow state 2022-09-20 16:48:45 +00:00
dump_helper.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
duplicating_objects.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
dynamic_settings_initializer.rb Cache dynamic settings in request cache 2022-03-07 22:38:17 +00:00
effective_due_dates.rb remove flag prioritize_individual_overrides 2022-08-17 18:06:37 +00:00
email_address_validator.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
enrollments_from_user_list.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
eportfolio_page.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
external_feed_aggregator.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
external_statuses.rb RuboCop: Style/MutableConstant 2021-11-16 16:19:54 +00:00
feature.rb remove enable_at / pending_enforcement from feature_flags 2022-05-19 01:30:59 +00:00
feature_flags.rb rename Canvas::DynamicSettings => DynamicSettings 2022-01-12 21:54:51 +00:00
file_authenticator.rb RuboCop: Style/CommentAnnotation 2021-11-21 00:50:46 +00:00
file_in_context.rb Stop duplicating files on repeat cartridge imports 2022-02-03 15:07:56 +00:00
file_splitter.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
global_lookups.rb make globalLookups a module to extend, not a stub 2021-10-26 14:58:27 +00:00
google_docs_preview.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
grade_calculator.rb Some rails 7 tests passing 2022-06-06 14:23:03 +00:00
gradebook_exporter.rb remove flag import_override_scores_in_gradebook 2022-08-25 15:38:22 +00:00
gradebook_grading_period_assignments.rb fix viewing grades for deactivated students 2022-02-16 17:56:03 +00:00
gradebook_importer.rb remove flag import_override_scores_in_gradebook 2022-08-25 15:38:22 +00:00
gradebook_settings_helpers.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
gradebook_user_ids.rb RuboCop: Rails/WhereExists 2021-11-16 21:19:43 +00:00
grading_period_helper.rb RuboCop: Style/RedundantSort 2021-11-19 22:25:07 +00:00
has_content_tags.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
host_url.rb Rails 6.1 basic spec functionality 2022-02-16 17:31:11 +00:00
i18n_time_zone.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
imported_html_converter.rb Convert audio and video RCE iframes to HTML tags for import/export 2022-04-18 16:17:53 +00:00
inst_fs.rb rename Canvas::DynamicSettings => DynamicSettings 2022-01-12 21:54:51 +00:00
late_policy_applicator.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
latex.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
learning_outcome_context.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
locale_selection.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
locked_for.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
logging_filter.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
login_hooks.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
math_man.rb rename Canvas::DynamicSettings => DynamicSettings 2022-01-12 21:54:51 +00:00
message_dispatcher.rb Improve error logging for message batch dispatching 2022-06-23 15:10:18 +00:00
message_scrubber.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
messageable_user.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
missing_policy_applicator.rb keep missing status around when default grading 2022-01-21 16:48:44 +00:00
model_cache.rb RuboCop: Style/BlockDelimiters, Style/Lambda 2021-11-23 21:30:47 +00:00
moderation.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
must_view_module_progressor.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
mutable.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
net_ldap_extensions.rb wrap net_ldap_extensions in a zeitwerk compatible module 2021-10-07 18:50:58 +00:00
notification_message_creator.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
package_root.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
permissions.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
permissions_helper.rb Some rails 7 tests passing 2022-06-06 14:23:03 +00:00
plannable.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
planner_api_helper.rb RuboCop: Performance/RegexpMatch 2021-11-11 22:02:06 +00:00
planner_helper.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
progress_runner.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
pronouns.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
quiz_math_data_fixup.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
request_cache.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
request_error.rb RuboCop: Style/RedundantSelf 2021-11-20 16:41:21 +00:00
rubric_context.rb RuboCop: Style/HashSyntax 2021-11-25 14:02:35 +00:00
scope_filter.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
score_statistics_generator.rb Improve score details and grade statistics 2022-07-20 13:24:01 +00:00
scrypt_provider.rb RuboCop: Layout lib 2021-09-22 20:01:52 +00:00
search_term_helper.rb Support basic unicode normalization in search helper 2022-02-16 22:19:10 +00:00
send_to_stream.rb Revert to state before "Add strand for create_stream_items" 2022-06-27 09:09:19 +00:00
sentry_proxy.rb Upgrade Sentry SDKs 2022-01-10 16:58:07 +00:00
session_token.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
simple_stats.rb RuboCop: Performance/Sum 2021-11-16 17:10:38 +00:00
simple_tags.rb Reference directly ConversationParticipant.quoted_table_name 2022-05-16 14:46:36 +00:00
sis.rb do away with non-conventional "common" module 2021-10-07 21:55:24 +00:00
sorts_assignments.rb RuboCop: Style/HashSyntax 2021-11-25 14:02:35 +00:00
ssl_common.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
stats.rb RuboCop: Style/HashSyntax 2021-11-25 14:02:35 +00:00
sticky_sis_fields.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
submission_list.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
submission_search.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
submittable.rb Consider only relevant discussions when evaluating CMPs 2022-07-14 13:51:37 +00:00
submittables_grading_period_protection.rb RuboCop: Style/MultilineIfModifier 2021-11-23 14:30:24 +00:00
summary_message_consolidator.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
syslog_wrapper.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
temp_cache.rb RuboCop: Style/PreferredHashMethods 2021-11-12 16:24:14 +00:00
text_helper.rb Bump i18nliner again 2022-08-10 22:04:14 +00:00
time_zone_helper.rb RuboCop: Style/HashConversion 2021-11-17 15:17:51 +00:00
timed_cache.rb RuboCop: Style/MethodCallWithoutArgsParentheses 2021-11-18 23:07:30 +00:00
token_scopes.rb hide internal permissions from LTI Advantage Services section 2022-08-29 19:36:02 +00:00
token_scopes_helper.rb Fail a test on route changes used by dev keys 2022-07-12 20:24:05 +00:00
turnitin.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
turnitin_id.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
unzip_attachment.rb Stop duplicating files on repeat cartridge imports 2022-02-03 15:07:56 +00:00
user_content.rb Increase depth limit for syllabus 2022-04-20 19:38:27 +00:00
user_list.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
user_list_v2.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
user_merge.rb improve user merge for user observee links 2022-08-31 17:20:28 +00:00
user_search.rb convert account users index roles scope query to AR syntax 2022-08-22 17:24:31 +00:00
uuid_helper.rb RuboCop: Style/MutableConstant 2021-11-16 16:19:54 +00:00
vericite.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
visibility_plucking_helper.rb RuboCop: Style/RedundantSelf 2021-11-20 16:41:21 +00:00
zip_extractor.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00