canvas-lms/lib/messageable_user
Ethan Vizitei cb32935905 Allow messaging account admins with no enrollments
closes CNVS-20958
refs CNVS-12003

Right now this tries to create "fake" enrollments for visibility
purposes if you have a user that is visible due to their account admin
status, but that doesn't work if that account admin has no enrollments.
Rather then trying to dress this up in a real enrollment type,
for account users I'm just using the type of "FakeEnrollment" and
letting that carry it through.  It removes an extra query, and makes it
so that account admins can still receive messages without having to
enroll in something.

TEST PLAN:
1) Create an account admin
2) In the api, attempt to send that admin a conversation message
3) The response should not be a 400 "invalid", but should instead
 be allowed to send to that admin

Change-Id: I9cdfbb536e64d757fe8fed0d70faa426a4167e4d
Reviewed-on: https://gerrit.instructure.com/57382
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
2015-09-01 20:58:39 +00:00
..
calculator.rb Allow messaging account admins with no enrollments 2015-09-01 20:58:39 +00:00