Commit Graph

55 Commits

Author SHA1 Message Date
E. Kolpakov
195d5b57bc pylint fixes 2015-01-12 09:58:51 -08:00
Braden MacDonald
c477bab6f4 Update the REST API course_team_handler to support library roles, fix bugs 2015-01-12 13:37:58 +03:00
Brandon DeRosier
046e295322 Change has_course_access definition and doc string
- has_course_access renamed to has_course_author_access for clarity
- Changed doc string to clearly state that it determines whether or not
  a user has write access to a course
2014-12-02 22:08:58 -05:00
Brandon DeRosier
bdc64a7c70 Moved has_course_access from CMS to student.auth (common) 2014-12-02 19:36:38 -05:00
stv
fb9f324f2f Fix PEP8: E303 too many blank lines 2014-11-10 11:00:14 -08:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
Calen Pennington
0d88379eeb Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds all of cms.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-07 12:56:43 -04:00
Don Mitchell
ad3140a6e6 Cleaned up modules to reflect centralizing auth 2014-01-14 17:04:44 -05:00
Don Mitchell
3ebac80778 Replace authz fns with roles.py ones
STUD-1006
2014-01-14 17:04:44 -05:00
Don Mitchell
b7368ef69a Change course_id to package_id
on new Locators to make it clear that they have a different syntax
than Location.course_id altho they represent the same info.
2013-12-20 16:16:50 -05:00
Don Mitchell
b776590226 Rename BlockUsageLocator's block_id field from usage_id
usage_id implies self-sufficiency. The block_id is relative to its structure.
2013-12-17 12:15:32 -05:00
David Baumgold
69899e24df Merge pull request #1823 from edx/db/mitxmako-edxmako
mitxmako => edxmako
2013-12-03 11:36:50 -08:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
Don Mitchell
9dc68b03a0 Improve auth handling of Locators
Ensure user admin screen gets the union of all possibly matching group names.
Smarter default group naming.
STUD-1003
2013-12-02 15:28:22 -05:00
Don Mitchell
f41816637e RESTful refactoring of /course access continued
Move index access into the url
Move course creation into the url
Add helper methods for testing to serialize json data and set accept header.
2013-10-30 13:28:22 -04:00
cahrens
355ebd62e3 Convert course team management to new URL scheme.
Move RESTful URLs into our "done" section.
2013-10-24 14:01:24 -04:00
Don Mitchell
8902a89fbc Have urls.py fully parse locator url 2013-10-22 10:44:03 -04:00
Don Mitchell
010905eb99 RESTful api for getting course listing and opening course in studio.
Pattern for how to do refactoring from locations to locators and from
old style urls to restful ones.
2013-10-16 16:54:31 -04:00
Christina Roberts
03b6050348 Merge pull request #667 from edx/christina/read-only-api
Make split mongo read-only API consistent with other modulestores.
2013-08-15 13:05:58 -07:00
David Ormsbee
3ce87583ab Shift enroll/unenroll logic to CourseEnrollment model, add is_active and mode.
Features coming down the pipe will want to be able to:
* Refer to enrollments before they are actually activated (approval step).
* See what courses a user used to be enrolled in for when they re-enroll in
  the same course, or a different run of that course.
* Have different "modes" of enrolling in a course, representing things like
  honor certificate enrollment, auditing (no certs), etc.

This change adds an is_active flag and mode (with default being "honor").
The commit is only as large as it is because many parts of the codebase were
manipulating enrollments by adding and removing CourseEnrollment objects
directly. It was necessary to create classmethods on CourseEnrollment to
encapsulate this functionality and then port everything over to using them.

The migration to add columns has been tested on a prod replica, and seems to be
fine for running on a live system with single digit millions of rows of
enrollments.
2013-08-14 13:23:06 -04:00
cahrens
e0aa46ab2d Make split mongo read-only API consistent with other modulestores. 2013-08-13 15:06:08 -04:00
ichuang
12ad9c8558 make CMS user view not show ErrorDescriptor courses 2013-08-11 15:27:12 +00:00
Christina Roberts
4c95078eb0 Merge pull request #578 from edx/christina/autoenroll
Auto-enroll course staff to fix "View Live".
2013-08-06 12:33:56 -07:00
chrisndodge
b24fdd9e22 Merge pull request #576 from edx/feature/cdodge/display-location-information-in-course-listings
Feature/cdodge/display location information in course listings
2013-08-06 10:27:38 -07:00
cahrens
3732d418c9 Add helper methods to hide internals of how users are enrolled in courses.
Remove _

Minor cleanup.
2013-08-06 09:36:39 -04:00
cahrens
a227b14fdd Auto-enroll course staff to fix "View Live".
STUD-554

Code review feedback.
2013-08-05 15:00:37 -04:00
David Baumgold
94976df8d7 Check that content-type starts with application/json
When Chrome sends the AJAX request to add a user to the course team, it sets the
Content-type to "application/json". However, when Firefox sends the same request,
it sets the Content-type to "application/json; charset=UTF-8". This commit only
checks that the Content-type begins with "application/json", not is identical
to it; that way, Firefox can play, too.
2013-08-05 14:16:28 -04:00
Chris Dodge
09a3bc01be show the organization, course number, course run in the course listing page in CMS 2013-08-05 12:51:42 -04:00
David Baumgold
607c06cba8 Stop using authz functions to change user groups
They contain too much incorrect permission checking
2013-08-01 11:24:42 -04:00
David Baumgold
64566c14e6 Fix unit tests 2013-07-29 13:12:07 -04:00
David Baumgold
a1b44afda3 Only instructors may make other instructors on a course 2013-07-29 13:12:05 -04:00
David Baumgold
42331464ed Can't remove last instructor of a course 2013-07-29 13:12:05 -04:00
David Baumgold
b6c69547de Check for instructor role before removing it 2013-07-29 13:12:04 -04:00
David Baumgold
f438552b3b Added unit tests for new course team API 2013-07-29 13:12:04 -04:00
David Baumgold
6a9074e185 Removed get_url_reverse function
It was causing unit tests to fail, and it's a needless bit of abstraction that
never should have existed in the first place.
2013-07-29 13:11:48 -04:00
David Baumgold
5c356bd379 Add button to add/remove instructor priviledges on course team page 2013-07-29 13:11:48 -04:00
David Baumgold
21a32370df Reorganize URLs and views around course team
Match other views better, saner URLs, more RESTful style, extensible for other roles
2013-07-29 13:11:48 -04:00
Christina Roberts
166aea62bb Merge pull request #341 from edx/talbs/studio-authorship
Studio: Authorship Rights Request UI + Dashboard Clean-up
2013-07-26 03:59:07 -07:00
Peter Fogg
060b2e17e5 Trim whitespace when adding course authors. 2013-07-22 15:58:22 -04:00
cahrens
6629d5d3a3 Merge branch 'master' into talbs/studio-authorship
Conflicts:
	cms/djangoapps/contentstore/views/user.py
	cms/static/sass/elements/_controls.scss
	cms/templates/activation_active.html
	cms/templates/activation_complete.html
	cms/templates/activation_invalid.html
2013-07-22 12:15:42 -04:00
Don Mitchell
3722685e1a No longer persist XModule templates
Instead, we use XModule field default values when creating an empty
XModule. Driven by this use case, we also allow for XModules to be
created in memory without being persisted to the database at all. This
necessitates a change to the Modulestore api, replacing clone_item with
create_draft and save_xmodule.
2013-07-16 14:33:58 -04:00
David Baumgold
a6f349dab9 Studio i18n 2013-07-12 16:25:39 -04:00
cahrens
d417a78c74 Tests for course creator status as returned in index page. 2013-07-12 11:25:12 -04:00
cahrens
9b2c384666 Add post callback to request course creator status. 2013-07-11 13:53:56 -04:00
cahrens
3715d6c429 Only send a single variable to index.html about authorship rights. 2013-07-11 12:39:51 -04:00
David Baumgold
17bef565f1 Added another test 2013-07-09 19:16:44 -04:00
David Baumgold
4155f9fe8c Removed unused user_author_string function 2013-07-09 19:16:44 -04:00
David Baumgold
32a902ca57 Remove create_json_response in favor of JsonResponse class 2013-07-09 19:16:43 -04:00
David Baumgold
628dff5398 pylint fixing 2013-07-09 19:16:43 -04:00
David Baumgold
cc4e01b4c6 Removed obsolete active_tab template variable 2013-07-09 19:15:58 -04:00