removed unused code to import an ical feed into a calendar,
and dropped the external_feed_id from the calendar_events
table because it isn't being used.
Change-Id: I9c093f4f2f63cc503d74bfc1cde089bf24ea0d73
Reviewed-on: https://gerrit.instructure.com/19615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
back-populate submission_versions from existing versions for
submissions, and insert new index rows when new versions for submissions
are created.
refs CNVS-2802
test-plan:
migration:
- have at least two submission with at least one submission with
multiple versions in your database before introduction of this
code
- run the migration
- for every existing submission version record, there should now be
a submission_versions record
- the submission_versions records should have the correct metadata
for the submission version
trigger:
- create a new submission
- should create a new submission_versions record
- modify the submission in a way that triggers a new version
- should create a new submission_versions record
Change-Id: I9c4c39fa60926b037142abf3f01572c9deaa0643
Reviewed-on: https://gerrit.instructure.com/19605
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
make this data fix postdeploy, and avoid find_in_batches issues
also remove :concurrently from a index created transactionally (on a new table)
Change-Id: If9744e13b2387eb1a310f19629fff6327000add5
Reviewed-on: https://gerrit.instructure.com/19834
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
This change is in anticipation of adding a more data inclusive grade
history API. Adds user_id and assignment_id to index as well.
Test Plan: n/a
refs CNVS-2802
Change-Id: Ib9f305612bbc48a6423ed955cd591d6de0658eb0
Reviewed-on: https://gerrit.instructure.com/19505
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
test plan:
* in an assignment description, add a link to an attachment
* delete the attachment
* re-upload the attachment with the same name (but different id
now)
* should be able to use the link still
* switch views and edit the link to break it by
adding "?verifier=somethingsomething" on the end of it
or shortening "/courses/:id/files/:file_id/download"
to "/files/:file_id/download"
* now run the migration/datafixup
* should be able to use the link again
fixes #CNVS-5137 #CNVS-5217
Change-Id: Ic7cd5f1acdecffce0e9ee953ca0dd732c65f2a75
Reviewed-on: https://gerrit.instructure.com/19377
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
There are three parts to this:
- API access for site admins and account admins. Account
admins can only see messages for their account.
- Includes start and end time parameters for basic searching
- Summary notification are gathered up per account now, so
account admins will not see a summary notification from
multiple accounts.
fixes CNVS-3695
test plan:
- Verify Admin Access:
- Have a user enrolled in two courses in separate root
accounts.
- Send the user ASAP notification from each account.
- Go to /users/:id/messages (the old interface) and verify
the messages appear there.
- As a site admin, get /api/v1/comm_messages for the user
(see documentation for the api).
- Verify that data for both messages are returned.
- Use the console to give an account admin on one of the
accounts :read_messages permissions.
- As the account admin, get /api/v1/comm_messages for the
user.
- Verify that only the message for the admin's account is
returned.
- Verify start_time and end_time parameters
- Use the console to modify the created_at field for the
user's messages
- As a site admin, get /api/v1/comm_messages for the user,
specifying various combinations of start_time and
end_time, and make sure the appropriate messages are
returned.
- Verify account based summaries
- Set the notification policies for the user to a summary
setting (daily or weekly)
- Send multiple notifications to the user from each account.
- Use the console to run the
SummaryMessageConsolidator::process function.
- View /messages for the user and verify that separate
summaries are sent for each account.
Change-Id: Ie33ec02cc2033a1cc2f1fcbe538b76792aab0e6c
Reviewed-on: https://gerrit.instructure.com/18586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
refs CNVS-4887
This probably should have happened anyway, but the intermediate model
will be necessary to handle attachments for the downloadable
quiz_statistics.csv
Test plan:
* make sure the quiz statistics page still works
* make sure downloading quiz statistics csv still works
Change-Id: I9562a731d171dae24329fc52782a4f9efa4cf8bd
Reviewed-on: https://gerrit.instructure.com/18977
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-4561
removed some duplicate work
memoized a couple of methods
now bails early when there are no slots signed up for
added a couple of indices
test plan
- make sure scheduler works the same as it used to
Change-Id: I9bea3daa5706eb5dba83d8112ea2ef8229ca0e0e
Reviewed-on: https://gerrit.instructure.com/19192
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
refs CNVS-4782
test plan:
- BEFORE applying database migrations, create two account
roles, one that enables "Manage account level settings",
and one that disables it.
- ... apply database migrations ...
- an account setting "Manage storage quotas" should appear
and should be enabled for roles that have "Manage account
level settings", and disabled otherwise
- ensure the following values cannot be changed
(are not editable on the web forms) if
"Manage storage quotas" permission is revoked:
in Account Settings:
- Default Course File Quota
- Default User File Quota
in Course Settings:
- File Storage
- also ensure that a user lacking this permission
cannot set a course quota via the courses API
(creating or updating a course). the value should
be ignored if the user does not have permission
to set it.
NOTE: This permission applies to accounts and courses.
There are also quotas for entire sites (for users,
course files, and media files), but these are managed
by a plugin and are not affected by this commit.
Change-Id: I4a3b0b332a5a4e74596f167360db37e2653eab70
Reviewed-on: https://gerrit.instructure.com/18887
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
creates new permission :manage_rubrics, which was
previously a subset of the rights in :manage_grades
test plan:
* confirm that a new permission for
outcomes and rubrics is available in the ui
* confirm that this permission restricts the
creation and editing of rubrics
fixes #CNVS-266
Change-Id: I40d108b53e2771890d8fdbb108e1de24364aa055
Reviewed-on: https://gerrit.instructure.com/17763
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
adds a new LTI extension, "content", that
defines the interaction for sending content from
a tool provider to the tool consumer. This extension
will replace the "embed_content" and '"select_link"
selection_directives, as well as adding allowing
am external tool to submit content for a homework
submission.
also starts sending intended_use, return_types, return_url
and file_extensions as part of the LTI launch with the new
extension.
test plan:
- make sure the "more" tab only shows up when there are valid tools
- install at least one valid tool
(make a homework_submission tool by taking the xml for
a resource_selection tool and replace "resource_selection"
with "homework_submission")
- click "more"
- make sure you can't submit the assignment when no
resource has been selected
- set an assignment that only allows file uploads
- try selecting a url from the tool
- make sure it errors out
- set an assignment that only allows file uploads
- limit the file types
- try selecting a file with a non-supported file extension
- make sure it errors out
- set an assignment that only allows file uploads
- try selecting an invalid file from the tool
- try submitting the homework
- make sure it errors out gracefully
- set an assignment that only allows file uploads
- try selecting a file from the tool
- make sure the submission works correctly
- set an assignment that only allows urls
- try selecting a file from the tool
- make sure it errors out
- set an assignment that only allows urls
- try selecting a url from the tool
- make sure the submission works correctly
Change-Id: I8df682bc73087681159110ab02f77f0e5a2b3911
Reviewed-on: https://gerrit.instructure.com/13419
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
adds scopes to access token and a new scope, 'userinfo'. when this scope is
used, a user may choose to remember authorization for a 3rd party. when this
option is selected, subsequent requests for an access token scoped to userinfo
will skip the the step where the user authorizes the app and will return userinfo
but no access token.
test plan:
* follow the oauth token flow adding a param for scopes=%2Fauth%2Fuserinfo to the initial request
- check the box for to remember authorization
- click login
* repeat the above request
* you should not see the request access page
* delete the tokens that were generated above
* run the test above, this time not remembering access
* you should see the request access page on the second request
Change-Id: I303a55d3c71de517ce6aa5fd8acd74d89aa4c974
Reviewed-on: https://gerrit.instructure.com/17604
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
this will allow migrations to have flexible todo items
and allow us to make a super awesome UI for helping
teachers fix any migration problems
Test Plan:
* Run a migration that has issues. :)
* exercise the issue api
closes CNVS-4230
Change-Id: I4577f811dd3b16aa200d381f039632b7cc2cd184
Reviewed-on: https://gerrit.instructure.com/18639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
This was written 2 years ago and never used, I've verified the DB tables
are empty.
Change-Id: I405e009be2eb657c4ebfb63da21dbcfee92efc0d
Reviewed-on: https://gerrit.instructure.com/18564
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
fixes CNVS-4588
test plan:
- enable the kaltura plugin
- find an old assignment that is set up to accept media recordings
- make sure that 'online media recording' is checked in the assignment view
- create a new assignment that accepts media recordings
- make sure the show page says "a media recording" under 'submitting'
Change-Id: Ia166c532f5ede0390afb2226d3cf4fb335814cf2
Reviewed-on: https://gerrit.instructure.com/18525
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
This allows us to make changes with how we generate that
id without breaking tool providers who depend on the old
way
This also sets the lti_quid to the value it was before the
1c6ae6979e change
Test Plan:
* Exiting root accounts lti_guid attribute should have the domain name in it
* New accounts will use the accounts UUID and thus have no domain name
refs CNVS-3829
Change-Id: Ib5b10cb097d3f0e5c562d1af70f5770217418e63
Reviewed-on: https://gerrit.instructure.com/18481
Reviewed-by: Zach Wily <zach@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
This is a common query in learning outcomes code, and was totally unindexed
Change-Id: I37b96cbaf62235a08a51ba6abce3ee1d7c17a271
Reviewed-on: https://gerrit.instructure.com/18401
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
caches the last page view on a course on the enrollment in an
after_filter
Test Plan:
- visit any page in a course
- in the console, the student's enrollment should have a
'last_activity_at' value that is recent
fixes CNVS-3825
Change-Id: I0ea38eb6399f4ea65617bb6a3e5f79dc8db9415c
Reviewed-on: https://gerrit.instructure.com/18154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
refs CNVS-3902
even if the preference is that they don't
test plan:
* bring up a fresh database
* it should not fail
Change-Id: I5e7b2cf8479de4b3f1564ee65cd1cb456ae4674e
Reviewed-on: https://gerrit.instructure.com/17873
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
identify "Reminder" category notifications as deprecated
fixes CNVS-3918, CNVS-3824
Explicitly run through 'rake db:load_notifications'
Testing Notes:
===========
* Run 'rake db:load_notifications'
* verify that it runs without error
* verify the 3 "Reminder" category entries
have their category changed to "DEPRECATED - Reminder"
Those are the following entries:
* Assignment Publishing Reminder
* Assignment Grading Reminder
* Assignment Due Date Reminder
* If desired, define a new notification type in
/app/messages/notification_types.yml
and verify that after rake task is run,
the new entry appears.
* Test setup of new database
Change-Id: Ib5dc69c7adc7a643f08ada94d9048274d8cd4e12
Reviewed-on: https://gerrit.instructure.com/17948
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fixes CNVS-3917
the notifications table had vestigial `body` and `sms_body`
columns that canvas no longer uses. this commit drops those
columns.
test plan:
* back up your database (unless you want to keep this
commit on your master branch forever);
* run migrations;
* verify that notifications still send as expected;
* for extra credit, configure canvas with a new database
and verify that db:initial_setup still works without
any errors.
Change-Id: Icc7d8c4e926b5ea0ecb8c3814fdc95481037a0c9
Reviewed-on: https://gerrit.instructure.com/17892
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
fixes CNVS-65, CNVS-3921
test plan:
* copy app/messages/new_discussion_entry.email.erb to
/app/messages/new_discussion_entry.email.html.erb;
* create a new discussion in a class with at least two
users (who have their discussion entry notifications
set to "immediately");
* as user 1, post a reply to the discussion;
* verify that user 2 receives a multipart email with
an html part and a plaintext part.
Change-Id: I30e3e15fa53817767c770491ab8c19286281e0aa
Reviewed-on: https://gerrit.instructure.com/17964
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
since a later migration will drop the table it works on
Change-Id: I37bd431b980a2e27622414fdbdc2c403efb086f8
Reviewed-on: https://gerrit.instructure.com/17818
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
closes CNVS-3417
test plan:
* after the migrations are run, ensure that every section has at
least one entry in CourseAccountAssociations in the database
* smoke test SIS imports
Change-Id: I261cad633788efbf4b0c64db34436ef695856fee
Reviewed-on: https://gerrit.instructure.com/17256
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
add Profile model which can be used by context-y things, and a basic
CourseProfile model
test plan: N/A, see https://gerrit.instructure.com/17020
Change-Id: I68f4a5a4f0913167e7e25e7bc231b5bf8394c335
Reviewed-on: https://gerrit.instructure.com/17019
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fixes CNVS-2200
normalize ignores out of the users.preferences column into
its own table. makes it more performant, and shard safe
test plan:
* add a user as a teacher in courses on two different shards
* set up an assignment needing grading (i.e. have a student
submit an assignment that requires grading) in both courses
* the assignment should show up on the teacher's dashboard
regardless of which shard he's on
* ignore the assignment on your dashboard on one shard
* reload - it should stay gone
* it should also be gone on the other shard
* have another student submit to that assignment
* it should come back on both shards for the teacher
* ignore it, permanently this time
* have another student submit to that assignment
* it should still be gone on both shards
Change-Id: I6646410273c6be05d4b21b29b6ab76feb8e65d0f
Reviewed-on: https://gerrit.instructure.com/17295
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
change the way we create the default course root folder
("course files") to use a atomic sql statement
this should prevent suspected race conditions from creating
multiple root folders for a course, as this causes the
files page to become unusable
test plan:
* Unfortunately there seems to be no consistent way to
reproduce the errors, and thus no consistent way to
test that this fixes the error
Change-Id: I223a2b230921752ef1175c82adfdd854e1331668
Reviewed-on: https://gerrit.instructure.com/17014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
when you upload a video, you will now see a [cc]
box in the player for that video if you are
the uploader of that video and in a modern browser.
it will have a link to upload a caption track in
SRT or WebVTT format in any language you specify.
once you attach a caption track to any of your
videos, other people that view it will be able
to choose that track while playing it.
helpful for people that are deaf or that speak
another language!
this change also adds google analytics tracking to
videos so we know when a given media_id was
played, paused, and ended.
Test Plan:
* record a video, go to play the video
* you should see a [cc] button
* click the "upload subtitles" link, a dialog should appear
that lets you choose a language and file to upload. here's
one you can test with:
http://mediaelementjs.com/media/NT113_u008_v005_transcript.srt
* refresh, you (and anyone else that can see video)
should now have the option to select that track
for subtitles. (if using in HTML5 player)
* you should see a delete 'x' on it to delete
it, when you click it it should go away. reload
to make sure it is not there.
* The user who created the video, or any admins of the course
the video is in should be able to manage these captions
closes CNVS-324
Change-Id: Id6d4abcb581f0daf101d601221dc45edaad6eaa8
Reviewed-on: https://gerrit.instructure.com/16882
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
refs CNVS-1171
test plan:
* begin a conversation with a (single) user from a different shard
* "re"-begin a conversation with the same user from a different
shard
* it should re-use the old conversation
* repeat, but using conversation batch (the async option in the API,
I think)
* begin a conversation between a teacher and a student on a different
shard
* have that teacher comment on a submission from that student
* the submission comment should show up in the existing conversation
Change-Id: I8d11de0e7a1d6e9c9ff8cbfc727819aedacd6602
Reviewed-on: https://gerrit.instructure.com/17026
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fixes CNVS-1171
test plan:
* full conversations regression test
* initiate a conversation with a user from another shard
* reply to that conversation from both the sender and the
receiver
* repeat for a group conversation involving two or more
shards
* repeat for huge batch conversations with hundreds of
users and two or more shards
* known NOT working yet:
* re-using the correct cross-shard private conversation
* probably the tagging of messages with Course x,
Group y, etc.
Change-Id: I52549039875941cd518077cea4e28bfd2bc10dbf
Reviewed-on: https://gerrit.instructure.com/16523
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
refs CNVS-1338
test plan:
* run the migration on production-like data
* it should not fail
Change-Id: Ib8527f2cbee05d5e00941286f16c245091b1a2d9
Reviewed-on: https://gerrit.instructure.com/17117
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
this was a course setting which allowed students to edit assignment
descriptions only. unfortunately, it didn't work, because the form validation
code assumed a title input field would be present and tried to require that it
was there.
closes CNVS-3267
test plan:
- make sure the setting is not availble in course settings
- make sure students cannot edit assignments
- make sure teachers can still edit assignments
Change-Id: Iebeaa00f357a59bff8462ecde79c57d68c04320f
Reviewed-on: https://gerrit.instructure.com/17056
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
also adds a new Progress class and API endpoint for
managing new background jobs.
fixes #CNVS-561
test plan:
* refer to the API documentation for Courses
and Progress
* use the Update Courses endpoint to offer, conclude,
and delete multiple courses in a batch
* use the Query Progress endpoint to check the
status of a batch
* make sure offering already published courses
succeeds, and also concluding already concluded
courses
Change-Id: I49d89c1f373f4999b6201574b43a20c53ef28b70
Reviewed-on: https://gerrit.instructure.com/16844
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
left over cruft from a very long time ago, in case we needed to
revert stuff
test plan:
* smoke test conversations
Change-Id: Ie222afc37dd17539e8e993857ed535c1bee4bade
Reviewed-on: https://gerrit.instructure.com/17197
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
This worked in 1.1 but throws a syntax error in 1.2 (which we don't
support yet, but will soon enough)
Change-Id: Ide2d3a39dd1700d04cb7a00620d77af273bf282b
Reviewed-on: https://gerrit.instructure.com/16991
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
so that user merges don't kill the db
test plan:
* merges of users with lots of conversations should be faster
Change-Id: I4cc8f9cc081f205639999c8486e9604d23bc0ff5
Reviewed-on: https://gerrit.instructure.com/17167
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
refs #CNVS-2326
Added a UserSearch module that provides
and interface for searching across the name,
the email, and the sis id (and the database id),
and added a trigram index on the columns
that will be searched against.
also made a slight refactor to the AR
initializer in order to expose
some of the behavior I wanted more granularly
and added some specs to cover it
fixed a small permissions bug in course.rb
and pulled some scoping out of the courses
controller down into the user search module
TEST PLAN:
This is currently not accessible from
the site itself, this is just the ground
work for the eventual user search api endpoint.
The code is not called by anything currently in
production either so there is no need for
regression testing. The one thing to check would
be the creation of new users (and pseudonyms and
communication channels). There have been new
indexes added to columns on those tables
and there is some documentation indicating
that writing to these indexes can be time
consuming if the data set is quite large. It
would be worth making sure that there have not
been any unacceptable performance regressions
in the creation of any of those record types in
a database that has a full load of data
(comparable to the production environment)
Change-Id: I8fb13a6ec714f27efc8012c5ed2bed4d963c24e6
Reviewed-on: https://gerrit.instructure.com/16459
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
test plan:
* a fresh account should not be able to visit /register
* enable self_registration in script/console for the account
(see the migration)
* you should now be able to visit /register
* no other changes should be visible
Change-Id: Ibfd6a0d23d3c3e37243ffb762e284b8907cd45cc
Reviewed-on: https://gerrit.instructure.com/16713
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
Avoid using the model, since the column may have already been added to
dropped_columns
Change-Id: I6d7eb623875572ebc3efe9c16e8f677d0fc61dc2
Reviewed-on: https://gerrit.instructure.com/16690
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
* wrap RoleOverride#permission_for with enabled_for? that also takes a
context of where the permission is being applied, and recalculates its
enabled-ness relative to that context; use that for checking account
admin and enrollment permissions
* refactor User#can_masquerade to properly check for descendant
permissions
test plan:
* create a custom role in site admin. give it permission to
manage permissions
* in script/console, find that override and set apply_to_self=false
* add a user to that role, and login as that user
* the user should not be able to change permissions in site admin
* the user should be able to change permissions in the default
account
* add another role in site admin. give it permission to manage
permissions
* in script/console, find the override and set apply_to_self=true,
apply_to_descendants=false
* add another user to that role, and login as that user
* the user should be able to change permissions in site admin
* the user should not be able to change permissions in the default
account
* the first user should not be able to masquerade as the second user
and vice versa
* an Account Admin should be able to masquerade as either user
* create a custom role in the default account, give it permission
to manage permissions, and add a user to that role
* the first user should be able to masquerade as the new user;
the second user should not be able to masquerade as the new user
* general regression tests on permissions and masquerading
Change-Id: I20a1183b7dfec419634a92cda498f245187060ef
Reviewed-on: https://gerrit.instructure.com/15896
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>