mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
ROLES AND PERMISSIONS - FIRST CHECK-IN
======================================= WARNING: DEV IS CURRENTLY VERY UNSTABLE. This is a mega-checkin of the new Roles system. A lot of changes have been made in core and modules. Currently there are a lot of rough edges and known problems. We are working hard on these .. .the reason for getting this into HEAD at this stage is enable us to move faster (our branch was diverging from HEAD too much). Please keep an eye on http://docs.moodle.org/en/Roles for current status and information for developers on how to use the new Roles system.
This commit is contained in:
parent
394577c3e4
commit
bbbf2d4015
139 changed files with 40452 additions and 2001 deletions
|
@ -16,16 +16,20 @@
|
|||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacheredit($course->id)) {
|
||||
close_window();
|
||||
}
|
||||
|
||||
if (! $group = get_record("groups", "id", $group, "courseid", $course->id)) {
|
||||
|
||||
if (! $group = get_record("groups", "id", $group, "courseid", $course->id)) {
|
||||
notice('Specified group could not be found!', "#");
|
||||
close_window_button();
|
||||
}
|
||||
}
|
||||
|
||||
// this is fine since group inherits course settings, this allows 1) teacher to edit all groups
|
||||
// 2 someone with a role with a cap to modify a specific group
|
||||
$context = get_context_instance(CONTEXT_GROUP, $group->id);
|
||||
|
||||
// this is really weird
|
||||
if (!has_capability('moodle/course:managegroups', $context->id)) {
|
||||
close_window();
|
||||
}
|
||||
|
||||
/// Print the headers of the page
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue