Commit Graph

25 Commits

Author SHA1 Message Date
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