Commit Graph

20 Commits

Author SHA1 Message Date
August Thornton 2c77683ac0 remove granular permissions for course files FF
closes FOO-1766
flag = none

[fsc-max-nodes=18]
[fsc-timeout=30]

Test Plan:
  - Run the migration and make sure there are no errors
  - Some things to check:
    * How it acts as a teacher, student, and public user
      in course files/folders and personal files/folders
      with the various settings above toggled to different states
    * How it acts as a teacher, student, and public user
      in discussions, modules, content migrations/import/exports
      (RCE should behave similarly throughout the site)
    * Should only be able to upload or add folders if the
      Course Files - add permission is enabled for the user's role
    * Should only be able to manage file access, usage rights, move,
      or rename course files/folders if the Course Files -
      edit permission is enabled for the user's role
      • Check Toolbar header at the top of Course files
      • Check Cog (hamburger menu) to the right of each file/folder
      • Check Usage Rights Indicator under usage rights column
        that can be found in course and group file pages. This can
        be enabled under course settings if not available
    * Should only be able to delete course files/folders if the
      Course Files - delete permission is enabled for the user's role
    * Any given user/role should have full access to their respective
      personal files/folders regardless of granted permissions. The
      same also applies to a group context with some caveats
      • Should not be able to modify file access in a group context
      • Should not be able to modify usage rights in personal files
    * A student enrollment not granted any file permissions (the default)
      should only be able to _view_ and _download_ files unless granted
      additional access from an authorizing role
    * REST API works as expected
    * UI works as expected with no additional javascript errors
Change-Id: I5e7f717494d658e6c8ec9be8a8039015afcebc63
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262775
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2021-07-16 15:31:37 +00:00
August Thornton 940f47ec07 add granular permissions for course files
Note: we'll want to re-run the data fix-up when we're ready to turn
on the feature flag permanently; in hopes to capture any differences
made to course files permissions between now and then.

Modified the files_controller quota and api_quota permission checks
to make them more lenient in regards to accepting any or all of the
files permissions role overrides. This allows legacy grouping and
new granularized files permissions to live in harmony and be modified
without causing unauthorized errors on the quota resource.

This commit will cover the backend permissions required to granularize
files / folders permission calls, however there will be a follow-up
ps to clean up the course file page to hide elements the user might
not be authorized to use.

closes FOO-130
refs FOO-1501
flag = granular_permissions_course_files
[fsc-max-nodes=18]
[fsc-timeout=30]

Test Plan:
  - Run the migration and make sure there are no errors
  - With the granular_permissions_course_files FF turned off,
    course sections and REST API should work the same with this patch
    set checked out as it does in beta/production
  - Some things to check:
    * How it acts as a teacher, student, and public user
      in course files/folders and personal files/folders
      with the various settings above toggled to different states
    * How it acts as a teacher, student, and public user
      in discussions, modules, content migrations/import/exports
      (RCE should behave similarly throughout the site)
  - With the granular_permissions_course_files feature flag turned on
    course files/folders and REST API should work as expected. The same
    list checked above should be done so again, but this time:
    * Should only be able to upload or add folders if the
      Course Files - add permission is enabled for the user's role
    * Should only be able to manage file access, usage rights, move,
      or rename course files/folders if the Course Files -
      edit permission is enabled for the user's role
      • Check Toolbar header at the top of Course files
      • Check Cog (hamburger menu) to the right of each file/folder
      • Check Usage Rights Indicator under usage rights column
        that can be found in course and group file pages. This can
        be enabled under course settings if not available
    * Should only be able to delete course files/folders if the
      Course Files - delete permission is enabled for the user's role
    * Any given user/role should have full access to their respective
      personal files/folders regardless of granted permissions. The
      same also applies to a group context with some caveats
      • Should not be able to modify file access in a group context
      • Should not be able to modify usage rights in personal files
    * A student enrollment not granted any file permissions (the default)
      should only be able to _view_ and _download_ files unless granted
      additional access from an authorizing role
    * REST API works as expected
    * UI works as expected with no additional javascript errors

Change-Id: Ieb2d10915c274959e8da4c623f7aba11d3540c2b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253777
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: August Thornton <august@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2021-01-27 17:02:38 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
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:48:35 +00:00
Brian Watson b521c1bd85 spec: un-skip specs in new_files_student_spec.rb
closes OUT-3815

flag=none

Test-plan:
 - flakey_spec_catcher passes
Change-Id: Iee1a6765235c34aa4aa8da9ba3d2487eb650c218
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244864
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2020-08-13 02:34:50 +00:00
Cody Cutrer a81944a73a rails 6: s/update_attributes/update/g
Change-Id: Ie137c1040260b363979160e1f0558883577ebebd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222510
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-01-09 20:56:35 +00:00
Robert Lamb 45e43c68f3 spec: skip flaky specs
Change-Id: I69dadd6a5aec6427a158eb23dfc2894d39c95e18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220878
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-12-16 15:31:38 +00:00
James Butters f6732e4167 spec: remove some specs for smoke
Change-Id: Ifa529fe9c6246c6e13bee1409613a4407ca19e13
Reviewed-on: https://gerrit.instructure.com/186178
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-03-29 13:00:05 +00:00
James Butters cd53947a79 spec: identify and tag existing smoke specs
Change-Id: I4d344521e2488b899a8b4450fca8deb4aab61a04
Reviewed-on: https://gerrit.instructure.com/181459
Reviewed-by: KC Naegle <knaegle@instructure.com>
Tested-by: Jenkins
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-02-25 20:22:36 +00:00
Robert Lamb 323bcad1ff spec: skip alert specs for Safari browser
Safari webdriver doesn't handle alerts, so we must skip
specs that handle alerts.

ps3: adjust indents

Change-Id: Ida57cb0e0b0fc6343943d05822af09a1aa434673
Reviewed-on: https://gerrit.instructure.com/132560
Tested-by: Jenkins
Reviewed-by: KC Naegle <knaegle@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
2017-11-15 21:11:44 +00:00
Landon Wilkins 813af5e261 da licença part 61
add consistent license headers to all source files

Change-Id: I04e795a2caed8035c4c25b5e304b381aa98b4276
Reviewed-on: https://gerrit.instructure.com/110312
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-01 21:23:23 +00:00
Jon Jensen a1d0a6943c spec: speed up slow specs
teacher specs already test teacher UI; just use factories. also don't
rely on implicit wait timeout to assert nonexistence of stuff

brings group time down from 2:27 -> 0:27
brings slowest example down from 0:26 -> 0:04.7

Change-Id: If1afe575308314bd44ad5e09426d58444b7d34d8
Reviewed-on: https://gerrit.instructure.com/98235
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-21 04:44:55 +00:00
Chris Hart 97a77dbb9a Files page: Long filenames overlap icon in Safari
Fixes: CNVS-26754

Test plan:
- Open a course or user file page in Safari (and
  other supported browsers)
- Rename a file or folder so the name is really long
  (see the screencast in JIRA that shows the bug)
- The bug where the filename overlaps the file-type
  icon should now be fixed
- Also made a couple of other small enhancements,
  which are detailed here:
  http://screencast.com/t/kWbJ6CsbImx

Change-Id: I86461da545375d235facf9f750ca00a2764f1c8b
Reviewed-on: https://gerrit.instructure.com/83399
Tested-by: Jenkins
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2016-06-30 16:13:18 +00:00
Jon Jensen 717680037e spec: rework negative dom assertions
fixes SD-1063, speeds up :allthethings:

negative DOM assertions are 💩, but if we must have them, make them
more tolerable. the old way:

  expect(f(".something-that-should-be-gone")).to be_nil
  expect(fj("buhleeted:visible")).to be_nil
  expect(fln("Can't Click Here Anymore").to be_nil

the new way:

  expect(container).not_to contain_css(".something-that-should-be-gone")
  expect(container).not_to contain_jqcss("buhleeted:visible")
  expect(container).not_to contain_link("Can't Click Here Anymore")

(you can of course use these new matchers for positive assertions as well)

although it's a tad more verbose, the new way is better because:

1. it's smart enough to bail once the assertion is met (versus the old way
   which would take 10-20 seconds to not find the thing and *then* run the
   assertion)
2. it requires them to be scoped, to reduce the likelihood of false
   positives (e.g. if the page is totally broken, then of course the
   assertion would pass)

also reworked the various flash message assertions... see the new
expect_flash_message and expect_no_flash_message

this should remove over an hour of linear time off the build (10 sec per
old assertion, except fj ones which took 20 sec)... so like a minute of
actual time, cuz parallelization :P

a consequence of this change is that f/fj/ff/ffj now raise if nothing is
found, so you really have to go out of your way to do it the bad way. so
don't :)

Change-Id: I0fe6e8500947c27d748b70bb2cda585edf71e427
Reviewed-on: https://gerrit.instructure.com/78420
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-05-03 20:05:46 +00:00
MFairbourn 0f917bcd6e spec: fix new_files specs to run with chrome.
Test Plan:
- Specs should pass
- Code review

Change-Id: I8dad776ff64c81ce2b0a0efa9afa3007bafe0b7c
Reviewed-on: https://gerrit.instructure.com/74437
Tested-by: Jenkins
Reviewed-by: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2016-03-14 22:19:27 +00:00
Jahnavi Yetukuri 0e9ac52676 spec: Logout,file,sis id specs
Change-Id: I0a95914a9ce59206414cda82b78a57169c754f83
Reviewed-on: https://gerrit.instructure.com/67189
Tested-by: Jenkins
Reviewed-by: Adam Phillipps <adam@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-11-16 22:48:29 +00:00
Michael Hargiss cc4b21444b spec: add modules to helper files
Test Plan:
 - Pass Jenkins

Change-Id: I2b5f8e9b5e9ab1c2bb0ecd38c440ee6d4ab031b8
Reviewed-on: https://gerrit.instructure.com/67155
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
2015-11-14 01:03:21 +00:00
Jahnavi Yetukuri f0324da429 spec: usage rights,restricted access
Change-Id: I1a8b9a060d31bda372583ec85c3eee4b9a9117c0
Reviewed-on: https://gerrit.instructure.com/66359
Reviewed-by: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-11-06 06:04:20 +00:00
Jahnavi Yetukuri 7ab44446e4 Preview and Restricted access for students specs
Change-Id: I83bd50d301f861149c5e7db5cbeda30d89904e86
Reviewed-on: https://gerrit.instructure.com/62076
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Product-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-08-31 21:27:31 +00:00
cguanzon 35b9cae005 spec:selenium: in-process server selenium tests is now a context
- reasoning: this group contains set-up and teardown,
  it does not include 'it' blocks

Change-Id: I1803420a5c7f59246f3af211e42ced808a994c3f
Reviewed-on: https://gerrit.instructure.com/60329
Tested-by: Jenkins
Reviewed-by: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-08-07 23:24:00 +00:00
Clare 0699b32cd4 new files student search specs
adds specs for student searching in files

Change-Id: I02fa88c87206284641c06376a2675def0d77c705
Reviewed-on: https://gerrit.instructure.com/58960
Tested-by: Jenkins
Reviewed-by: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Pedro Fajardo <pfajardo@instructure.com>
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
2015-07-22 17:21:24 +00:00