When an account enables k5 mode, store that account's id in its root
account's settings hash. Similarly, when an account disables the
setting, remove it from the set.
Also updates the checks on the dashboard to see if a user should see
the k5 dashboard based on whether they're associated with an account
who has enabled the k5 setting and with a root account where the FF is
enabled.
flag=canvas_for_elementary
closes LS-1919
closes LS-1920
Test plan:
- Have an account with a subaccount
- Enable k5 FF at the root
- In the subaccount's account settings, enable the k5 setting
- In a rails console, expect
`Account.find({root_id}).settings[:k5_accounts]` to include the
account id of the subaccount
- Disable the subaccount k5 setting
- Expect the query to now not include anything
- Enroll a user in a course that's part of a subaccount with the
k5 setting enabled
- On that user's dashboard, expect to see k5 dashboard
- Disable either the setting or the flag; expect to see traditional
dashboard
- Expect other user's dashboards not to be affected
Change-Id: I7a70a10063fad8f78677cf8be9be77cbdb1a49d7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259865
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>