Commit Graph

40 Commits

Author SHA1 Message Date
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
Cody Cutrer 224377a50c only skip feature flag cache for the immediate model
i.e. the page you're on. this prevents constantly querying site admin
feature flags directly when getting user feature flags, while still
preserving what looks like cache coherency when you flip an account
level feature flag

Change-Id: I694c83da3d548ae34428d3ffd8e18e2384df6656
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249645
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-08 22:08:06 +00:00
Cody Cutrer de5707686d cache feature_flag_account_ids in MultiCache for root accounts
Change-Id: I70792d730178f948efd3031c4dad82120a88a7c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246119
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>
2020-08-27 15:37:01 +00:00
Jacob Burroughs f6a1b11f59 Hide inherited enabled FFs
fixes FOO-599

test plan:
- Enable a feature flag in siteadmin
- It should not appear in regular accounts
- Enable a course and account flag in a regular account
- On refresh they should still appear
- The course flag should not appear in courses in the account

Change-Id: I6af96794b0f0f9a5534374dd32b3b539a4b7f486
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244506
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2020-08-07 21:10:13 +00:00
James Williams 99c0692502 don't cache site admin feature_flag_account_ids
Change-Id: I200163a12c002d6cf4e6b3deba597dff4612c81e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232114
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-03-30 16:01:56 +00:00
James Williams bbdc741594 skip feature flag cache when showing API results to admins
test plan:
* in a production-like environment, feature flag changes should
 not appear to be undone when refreshing the page (while the
 cache is still in the process of invalidating)

closes #ADMIN-2939

Change-Id: I495820850f8facaa6965188140d979bd5227994d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/211436
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-10-21 12:12:38 +00:00
James Williams 8241b4ebaf don't cache context on feature flag
sometimes can't be marshalled

Change-Id: I10e7f2211272ecc575a0a805e7e8b271b984434d
Reviewed-on: https://gerrit.instructure.com/199499
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-06-28 16:27:11 +00:00
James Williams 77d6d56b5e raise error on missing feature
because clay can't spell

also get rid of that feature flag enabling on
every user in specs

also handle development features disabled in prod

Change-Id: Ifd6c590011e6963e7acea90f8f58bd2372123d26
Reviewed-on: https://gerrit.instructure.com/171781
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-26 16:22:32 +00:00
Keith T. Garner 061e538ba1 Revert "raise error on missing feature"
Looks like it broke for development feature flags when canvas was
running in production mode.

This reverts commit 974a6e809a.

Change-Id: I1946137a2c4fade435ca00fde75f2dcb3a795ac4
Reviewed-on: https://gerrit.instructure.com/171728
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Jenkins
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2018-11-08 22:59:23 +00:00
James Williams 974a6e809a raise error on missing feature
because clay can't spell

also get rid of that feature flag enabling on
every user in specs

Change-Id: I96b72b94f7421a4d7b1c0215d36733f369862b2f
Reviewed-on: https://gerrit.instructure.com/171457
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2018-11-08 14:29:08 +00:00
James Williams 1b2c16c7e6 wrap request cache around common dashboard calls
Change-Id: Ie6c9e4a2682d76f9d82131f38a0ff979e192f2fa
Reviewed-on: https://gerrit.instructure.com/162291
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-08-28 15:16:14 +00:00
Cody Cutrer 37e5beb956 use a consistent current shard for feature_flag_account_ids cache
Change-Id: I4ca66fd4a40e3f84987ab2b82391462fa479de8f
Reviewed-on: https://gerrit.instructure.com/142660
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-03-06 05:47:52 +00:00
Han Yan f1bb548d7c Quizzes Next Feature Flag support
closes QUIZ-203, closes QUIZ-3434

test plan:
  case 1: when a root account is not provisioned by uuid provisioiner
  - 'Quiz Next' feature flag is not visible in root account, sub
    accounts and courses

  case 2: when a root account is provisioned by uuid provisioiner
  - should see 'Quiz Next' feature flag in root account
  - when the FF in root account is turned to On, all courses have access
    to Quizzes.Next (Quiz Migration and Easy button)
  - when the FF is off, all courses don't have access to Quizzes.Next
  - when the FF is allowed, subaccounts and courses should have options
    to turn Quizzes.Next On or Off

Change-Id: Ib41ce2db9943151f47ad42a676d29b744c381799
Reviewed-on: https://gerrit.instructure.com/135805
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2018-01-11 22:39:42 +00:00
Simon Williams ffca880b71 correctly invalidate course/user feature flag cache
test plan:
- change a course/user feature flag
- the change should stick and apply

Change-Id: I2b4045bf6a0c5c57c58591c98ddcd513e8243fa0
Reviewed-on: https://gerrit.instructure.com/126202
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-09-15 20:19:49 +00:00
Cody Cutrer 102dca8bdc don't use multicache for course and user feature flags
closes CNVS-39324

Change-Id: I6c9fccaddd3661e3fdc350e94ae9e58854a544ad
Reviewed-on: https://gerrit.instructure.com/125792
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-12 21:38:14 +00:00
Landon Wilkins 79215618d4 da licença part 29
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I49a8930917a609d3f118da1b20b51dedfd5d5903
Reviewed-on: https://gerrit.instructure.com/110053
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-27 21:59:53 +00:00
James Williams 603058d22e don't set inverse association on feature flags
slightly less performant but it'll fix whatever's associated with
the user that's causing marshalling errors sometimes

closes #CNVS-35073

Change-Id: Id4c18b6de829687c3a7d734fa16629fc3457bd5b
Reviewed-on: https://gerrit.instructure.com/102688
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Gentry Beckmann <gbeckmann@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-02-19 00:52:06 +00:00
Stewie (Nicholas Stewart) 5b0d053da2 Assignment model requires a due_at
This is one piece of SIS-2636

Refs: SIS-2636

Test Plan:
  Verify that an assignment requires a due date under certain
  conditions:
    assignment.post_to_sis = true
    account's sis_require_assignment_due_date is true
    the new_sis_integrations feature flag is on

Change-Id: Id614b6606127cad630b7c622c94893289aad59e6
Reviewed-on: https://gerrit.instructure.com/99181
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Tested-by: Jenkins
Product-Review: Oxana
2017-01-16 20:59:13 +00:00
James Williams 0126d90e8e set inverse_of for polymorphic associations, again
basically means we don't have to reload the contexts
all the time

also make sure that inverse associations are populated
when calling temp_record

Change-Id: I2a0baefeccc814746a241f506a8f2db02aa8eebf
Reviewed-on: https://gerrit.instructure.com/99642
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
2017-01-16 20:15:20 +00:00
Landon Wilkins 7bc6743b0b Revert "set inverse_of for polymorphic associations"
This reverts commit c20d270a4a.

Change-Id: I0227de546fc7ea22efd6b2acb6b77982f52bde52
Reviewed-on: https://gerrit.instructure.com/99570
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-13 18:50:07 +00:00
James Williams c20d270a4a set inverse_of for polymorphic associations
basically means we don't have to reload the contexts
all the time

also make sure that inverse associations are populated
when calling temp_record

Change-Id: I22adf77d218f8084f76632d397161c05945cbae4
Reviewed-on: https://gerrit.instructure.com/98381
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-13 12:37:26 +00:00
Cody Cutrer 36fe264507 don't bother caching a constant for feature flags
refs CNVS-30659

Change-Id: If90aedf26994f0012fa1efebf875451779c2cc97
Reviewed-on: https://gerrit.instructure.com/86712
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-02 20:25:43 +00:00
Derek Bender 0f2a46b95c Merge branch 'master' into dev/grading-periods-update
Change-Id: Iebae44c64860efd766ca7e288ca1ec112a790456
2016-06-20 10:22:17 -05:00
James Williams 304667fa85 add request cache around feature_flag_account_ids
gets called multiple times per request

Change-Id: Id630760d1b34724d3d089e7dd48ad1c8268078b8
Reviewed-on: https://gerrit.instructure.com/82632
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-06-16 12:19:27 +00:00
Spencer Olson 3ba3d62761 Merge branch 'master' into dev/grading-periods-update
Change-Id: Idaf66797a745b9c43aeb70361d476b621799a43f
2016-05-16 13:43:22 -04:00
Jeremy Stanley c8cfaa1e1c fix feature flag page error with hidden+root_opt_in
test plan:
As a site admin user,
 1. Set "Post grades to SIS" to Allowed in a root account
 2. Turn it on in a course
 3. Turn it back off in the root account
 4. Return to the course and reload the feature settings page
 5. The page should load without error

NOTE: the fact that "Post grades to SIS" is still enabled in
the course is the subject of CNVS-29319 and will be addressed
separately.  tl;dr hidden features are weird

fixes CNVS-29365

Change-Id: Ia9958bb6d4a56dc45a717503e437816a82e89b0c
Reviewed-on: https://gerrit.instructure.com/79631
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-05-16 17:01:25 +00:00
Spencer Olson 92712ebcbb rip out copying logic for grading periods
remove the copying of grading periods. teachers
and sub-account admins can no longer create
grading periods (although they can still edit
and delete previously-created grading periods),
and they cannot edit root account grading periods.

closes CNVS-26727

test plan:

 1. Course level
 - sign in as a teacher in a course with multiple
   grading periods enabled
 - navigate to the grading periods page at
   /courses/:course_id/grading_standards
 - if there are existing course-level grading
   periods, verify you can edit and delete them
 - verify you cannot create new grading periods
 - if there are not existing course-level grading
   periods, verify account level grading
   periods show up and they are not editable (if
   the sub-account owning the course has grading
   periods, sub-account periods should be displayed.
   if the sub-account does not exist or does not have
   grading periods, the root-account grading periods
   should be displayed)

 2. Root account level
 - sign in as a root account admin and go to the
   account grading periods page at
   /accounts/:account_id/grading_standards
 - verify you can still add new grading periods
   and you can edit existing grading periods

 3. Sub-account level
 - sign in as a sub-account admin and go to the
   sub-account grading periods page at
   /accounts/:sub_account_id/grading_standards
 - if there are existing sub-account grading
   periods, verify you can edit and delete them
 - verify you cannot create new grading periods
 - if there are not existing sub-account grading
   periods, verify root account grading
   periods show up and they are not editable

Change-Id: If2083defa524a81cbc557e39350b553c417e6f81
Reviewed-on: https://gerrit.instructure.com/77396
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-05-05 22:18:51 +00:00
Cody Cutrer e1529eb1ae switch a few things to use account_chain
instead of assuming [self, Account.site_admin]

refs CNVS-26291, CNVS-26292

Change-Id: I8c20a3e29f5af91d04e380794f21705706fd96a8
Reviewed-on: https://gerrit.instructure.com/69841
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-01-18 17:51:42 +00:00
Cody Cutrer ee17716731 remove some kludge-caching of :nil
that was only needed in rails 2

Change-Id: I1e2a00f65237d45ac82daa19eaecf5c589171718
Reviewed-on: https://gerrit.instructure.com/61025
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-08-17 19:27:27 +00:00
Cody Cutrer abc23822f1 improve multicache
explicitly have one copy per node in a ring (instead of relying
on hashing of a different to hopefully evenly spread copies around
the ring).

test plan:
 * configure a ring of redis servers for cache
 * canvas should still work

Change-Id: I17e086aac28c1c095c9717a7625ca51c86d0598f
Reviewed-on: https://gerrit.instructure.com/48069
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-05-06 19:21:21 +00:00
James Williams 16cb09f65e search for feature flags on the correct shard
something i came across while reading some logs

refs #CNVS-14539

Change-Id: Iaec7a290f49c2fa5a4e52550c14918abbdbfec44
Reviewed-on: https://gerrit.instructure.com/53106
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-04-30 12:53:41 +00:00
Jeremy Stanley 8e134c6c20 import files as unpublished if usage rights required
test plan:
 0. enable "better file browsing" and "usage rights required"
    in a course
 1. upload and expand a zip file and confirm the files are
    unpublished initially
 2. confirm that a file imported from an imscc package is
    (a) unpublished in the new course if no usage rights
        were set in the source course, regardless of whether
        the file was published in the source course
    (b) unpublished in the new course if it was unpublished
        in the source course, regardless of whether usage
        rights were set in the source course
    (c) published in the new course if it was published in
        the source course and had usage rights set.
 3. repeat step 2, but with course copy instead

fixes CNVS-19620

Change-Id: I9a32adeafb94e4922ba95ad6466c72aca3fd3598
Reviewed-on: https://gerrit.instructure.com/52465
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-04-21 17:37:30 +00:00
Cody Cutrer b1abbc453b spread feature flag cache around a ring
Change-Id: I4831cc45d8646f6f86a34ade6546644c4dacdd49
Reviewed-on: https://gerrit.instructure.com/48065
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-02-03 01:05:24 +00:00
James Williams 0018d01b51 hide quiz answer audit log permission based on feature flag
test plan:
* confirm that the permission to "View the answer matrix
 in Quiz Submission Logs" is only visible when the
 "Quiz Log Auditing" feature flag is allowed on the
 account level

closes #CNVS-18192

Change-Id: Ibbd0a082af20e49ef5fd5471c22ce6c236fbfade
Reviewed-on: https://gerrit.instructure.com/47820
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins
2015-01-28 21:19:32 +00:00
Michael Nomitch 506e786db4 DA - modules
fixes CNVS-14095
fixes CNVS-15157

test plan:
  - with DA on and off
    - go to modules page
      - only the right assignments show
      - completion requirements ignore
        assignments that cant be seen by a user
    - modules page works with changing sections
      - complete/incomplete updates properly
      - as does locked/unlocked
    - modules page shows correct content when
      a students grade is deleted and this makes
      them lose assignment visibility
    - modules api doesnt return any content that
      a student cannot see

Change-Id: Ia1acfd919214823cdfc3b45e974876b4529bb14d
Reviewed-on: https://gerrit.instructure.com/38970
Product-Review: Hilary Scharton <hilary@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
2014-09-22 21:23:44 +00:00
Cody Cutrer b28378e1d0 don't do a query just to convert an id to an object with just an id
Change-Id: Iba0c38881fc37a44391ed7e4882a0ba0e147236c
Reviewed-on: https://gerrit.instructure.com/40480
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-03 19:00:46 +00:00
Jeremy Stanley 9ca772e63a let site admin see hidden features in any context
test plan:
 - a site admin user should be able to see the hidden
   lor_for_user feature in User settings
 - a non-site admin user should not be able to see it,
   unless a site admin user has already set it for the user

fixes CNVS-14779

Change-Id: If9a42546b209607b8728ecdb682ad0aeefe99136
Reviewed-on: https://gerrit.instructure.com/39292
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-08-14 19:21:29 +00:00
Cody Cutrer cd1bb984e7 improve feature flag caching
* properly cache nil per context
 * cache the full lookup in-proc only

test plan:
 * quick regression test of feature flags

Change-Id: I0d2435777bcc82d01301af96df81f179366b2fdc
Reviewed-on: https://gerrit.instructure.com/28118
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-07 16:10:20 +00:00
James Williams 5323c595ca don't cache full feature_flag_accounts
prevents Marshall.dump errors that may occur
when trying to cache the Accounts with their
associations intact

fixes #CNVS-10055

Change-Id: I71195869feaf58ac2f8beeb5fc830d23d5f98bbd
Reviewed-on: https://gerrit.instructure.com/27710
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2013-12-20 20:22:36 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

 - Use the "list features" endpoint as a root account admin
   (with no site admin privileges), on the root account context, and
   confirm that hidden features do not show up
 - Use the "list features" endpoint as a site admin user,
   on the root account context, and confirm that hidden features
   show up
 - Use the "list features" endpoint on the site admin account
   and confirm the hidden features show up

 - Use the "set feature flag" endpoint on a hidden feature on site
   admin and ensure the feature becomes visible in all root accounts
 - Use the "set feature flag endpoint" on a hidden feature on a
   single root account, and ensure the feature becomes visible to
   that root account and not others

 - Confirm that root_opt_in features appear "Off" by default
   in root accounts, after being "Allowed" in code or site admin

 - Confirm a feature flag that is set to "on" or "off" (vs. "allowed")
   cannot be overridden in a lower context (and the API returns
   locked=true for them)

 - Confirm that setting locking_account_id requires admin rights
   in the locking account
 - Confirm that a feature flag with locking_account_id cannot be
   changed without admin rights in the locking account (e.g.,
   set a feature flag on a course, locked with the root account's id,
   and make sure a teacher who is not an account admin can't change it)

 - Confirm feature flags can be deleted with the "remove feature flag"
   endpoint (and they are only deleted where they are defined, not
   when called on an object that inherits a flag)

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00