From 8c900bc3b0ae44d8a51a540cfb2e0f486c6f2cd2 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 31 Oct 2006 08:14:36 +0000 Subject: [PATCH] Merged documentation for Roles from stable MDL-6923 --- admin/roles/assign.php | 15 ++++++----- admin/roles/manage.php | 8 +++--- admin/roles/override.php | 12 +++++---- lang/en_utf8/help/assignroles.html | 34 +++++++++++++++++++++++ lang/en_utf8/help/contexts.html | 24 +++++++++++++++++ lang/en_utf8/help/index.html | 10 ++++++- lang/en_utf8/help/overrides.html | 40 +++++++++++++++++++++++++++ lang/en_utf8/help/permissions.html | 28 ++++++++++++++----- lang/en_utf8/help/roles.html | 43 ++++++++++++++++++++++++++++++ theme/standard/styles_fonts.css | 10 +++++-- theme/standard/styles_layout.css | 36 ++++++++++++++----------- 11 files changed, 222 insertions(+), 38 deletions(-) create mode 100644 lang/en_utf8/help/assignroles.html create mode 100644 lang/en_utf8/help/contexts.html create mode 100644 lang/en_utf8/help/overrides.html create mode 100644 lang/en_utf8/help/roles.html diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 9953feb50c..2f98fa4bca 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -116,7 +116,6 @@ $adminroot = admin_get_root(); admin_externalpage_setup('assignroles', $adminroot); admin_externalpage_print_header($adminroot); - print_heading($straction); } else { $currenttab = ''; $tabsmode = 'assign'; @@ -179,6 +178,9 @@ } } + + print_heading_with_help(get_string('assignroles', 'role'), 'assignroles'); + if ($roleid) { /// prints a form to swap roles /// Get all existing participants in this context. @@ -243,14 +245,15 @@ $table->tablealign = 'center'; $table->cellpadding = 5; $table->cellspacing = 0; - $table->width = '20%'; - $table->head = array(get_string('roles', 'role'), get_string('users')); - $table->wrap = array('nowrap', 'nowrap'); - $table->align = array('right', 'center'); + $table->width = '60%'; + $table->head = array(get_string('roles', 'role'), get_string('description'), get_string('users')); + $table->wrap = array('nowrap', '', 'nowrap'); + $table->align = array('right', 'left', 'center'); foreach ($assignableroles as $roleid => $rolename) { $countusers = count_role_users($roleid, $context); - $table->data[] = array(''.$rolename.'', $countusers); + $description = format_string(get_field('role', 'description', 'id', $roleid)); + $table->data[] = array(''.$rolename.'',$description, $countusers); } print_table($table); diff --git a/admin/roles/manage.php b/admin/roles/manage.php index 9036301b52..87621a6d02 100755 --- a/admin/roles/manage.php +++ b/admin/roles/manage.php @@ -281,13 +281,13 @@ switch ($action) { case 'add': - print_heading_with_help(get_string('addrole', 'role'), 'role'); + print_heading_with_help(get_string('addrole', 'role'), 'roles'); break; case 'view': - print_heading_with_help(get_string('viewrole', 'role'), 'role'); + print_heading_with_help(get_string('viewrole', 'role'), 'roles'); break; case 'edit': - print_heading_with_help(get_string('editrole', 'role'), 'role'); + print_heading_with_help(get_string('editrole', 'role'), 'roles'); break; } @@ -318,6 +318,8 @@ } else { + print_heading_with_help(get_string('roles', 'role'), 'roles'); + $table = new object; $table->tablealign = 'center'; diff --git a/admin/roles/override.php b/admin/roles/override.php index b7ae733523..2fa95ba380 100755 --- a/admin/roles/override.php +++ b/admin/roles/override.php @@ -141,6 +141,7 @@ include_once('tabs.php'); } + print_heading_with_help(get_string('overrides', 'role'), 'overrides'); $overridableroles = get_overridable_roles($context); @@ -188,15 +189,16 @@ $table->tablealign = 'center'; $table->cellpadding = 5; $table->cellspacing = 0; - $table->width = '20%'; - $table->head = array(get_string('roles', 'role'), get_string('overrides', 'role')); - $table->wrap = array('nowrap', 'nowrap'); - $table->align = array('right', 'center'); + $table->width = '60%'; + $table->head = array(get_string('roles', 'role'), get_string('description'), get_string('overrides', 'role')); + $table->wrap = array('nowrap', '', 'nowrap'); + $table->align = array('right', 'left', 'center'); foreach ($overridableroles as $roleid => $rolename) { $countusers = 0; $overridecount = count_records_select('role_capabilities', "roleid = $roleid AND contextid = $context->id"); - $table->data[] = array(''.$rolename.'', $overridecount); + $description = format_string(get_field('role', 'description', 'id', $roleid)); + $table->data[] = array(''.$rolename.'', $description, $overridecount); } print_table($table); diff --git a/lang/en_utf8/help/assignroles.html b/lang/en_utf8/help/assignroles.html new file mode 100644 index 0000000000..cba3ab0abe --- /dev/null +++ b/lang/en_utf8/help/assignroles.html @@ -0,0 +1,34 @@ +

Assigning Roles

+ +

+By assigning a role to a user in a context, you +are granting them the permissions contained +in that role, for the current context and all +"lower" contexts. +

+ +

+Contexts: +

    +
  1. Site/System
  2. +
  3. Course Categories
  4. +
  5. Courses
  6. +
  7. Blocks and Activities
  8. +
+

+ +

+So for example, if you grant a Student role to a +user in a Course, they will have that role for +the course, but also all Blocks and Activities inside +that course. Their actual permissions may depend on +other roles and overrides that have been defined. +

+ +

+See also +Roles, +Contexts, +Permissions and +Overrides. +

diff --git a/lang/en_utf8/help/contexts.html b/lang/en_utf8/help/contexts.html new file mode 100644 index 0000000000..5cdb6903ee --- /dev/null +++ b/lang/en_utf8/help/contexts.html @@ -0,0 +1,24 @@ +

Contexts

+ +

Contexts are the "areas" in Moodle where roles + can be assigned to people

+ +

They are arranged in a hierarchical fashion, with permissions + inherited from "higher" to "lower" contexts.

+ +
    +
  1. Site (System)
  2. +
  3. Course Categories
  4. +
  5. Course Sub-categories
  6. +
  7. Courses
  8. +
  9. Blocks and Activities
  10. +
+

+ +

+See also +Roles, +Permissions, +Assign Roles and +Overrides. +

diff --git a/lang/en_utf8/help/index.html b/lang/en_utf8/help/index.html index 7034e46c23..be082e162b 100644 --- a/lang/en_utf8/help/index.html +++ b/lang/en_utf8/help/index.html @@ -9,6 +9,15 @@
  • How to search
  • +

    Roles

    + +

    Administration

    Setting up courses

    diff --git a/lang/en_utf8/help/overrides.html b/lang/en_utf8/help/overrides.html new file mode 100644 index 0000000000..ee645ed9e5 --- /dev/null +++ b/lang/en_utf8/help/overrides.html @@ -0,0 +1,40 @@ +

    Overrides

    + +

    +Overrides are specific permissions designed to override a +role in a specific context, allowing you to "tweak" your +permissions as required. +

    + +

    +For example, if users with the role Student in your course +can usually start new discussions in forums, but there is +one particular forum for which you want to restrict that +capability, then you can set an override that PREVENTS +the capability for Students to "Start new discussions". +

    + +

    +Overrides can also be used to "open up" areas of your +site and courses to give users extra permissions where +it makes sense. For example, you may want to experiment +giving Students the ability to grade some assignments. +

    + +

    +The interface is similar to the one for defining roles, +except sometimes only relevant capabilities are shown, +and you will also see some capabilities highlighted to +show you what the permission for that role would be +WITHOUT any override active (ie when your override is +set to INHERIT). +

    + + +

    +See also +Roles, +Contexts, +Assign Roles and +Permissions. +

    diff --git a/lang/en_utf8/help/permissions.html b/lang/en_utf8/help/permissions.html index 147aed7a83..9e28c66f2b 100644 --- a/lang/en_utf8/help/permissions.html +++ b/lang/en_utf8/help/permissions.html @@ -12,7 +12,7 @@ For example, one capability is "Start new discussions" (in forums). In each role, you can choose to set the permission for such a capability to one of four values:
    -
    Inherit
    +
    INHERIT
    This is the default setting, generally. It's a neutral setting that means "use whatever setting the user already had". If a role gets assigned to someone (eg in a course) that has this permission for @@ -22,7 +22,7 @@ to one of four values: level, then the user will have no permission for that capability.
    -
    Allow
    +
    ALLOW
    By choosing this you are granting permission for this capability to people who are assigned this role. This permission applies for the context that this role gets assigned plus all "lower" @@ -32,12 +32,12 @@ to one of four values: override or a new assignment with a Prevent or Prohibit value for this capability.
    -
    Prevent
    +
    PREVENT
    By choosing this you are removing permission for this capability, even if the users with this role were allowed that permission in a higher context.
    -
    Prohibit
    +
    PROHIBIT
    This is rarely needed, but occasionally you might want to completely deny permissions to a role in a way that can NOT be overridden at any lower context. A good example of when you might need this is @@ -52,13 +52,29 @@ to one of four values:

    Conflict resolution of permissions

    +

    Permissions at a "lower" context will generally override + anything at a higher "context" (this applies to overrides + and assigned roles). The exception is PROHIBIT which can not + be overridden at lower levels. +

    +

    If two roles are assigned to a person in the same context, one with - Allow and one with Prevent, which one wins? In this case, Moodle will + ALLOW and one with PREVENT, which one wins? In this case, Moodle will look up the context tree for a "decider".

    For example, a student has two roles in a course, one that allows them to start new discussions, one that prevents them. In this case, we check the categories and the site contexts, looking for another defined permission to help us decide. If we don't find one, then - permission is prevented by default (the two settings cancelled each other out). + permission is PREVENT by default (because the two settings cancelled + each other out, and thus you have no permission). +

    + + +

    +See also +Roles, +Contexts, +Assign Roles and +Overrides.

    diff --git a/lang/en_utf8/help/roles.html b/lang/en_utf8/help/roles.html new file mode 100644 index 0000000000..1b26153de7 --- /dev/null +++ b/lang/en_utf8/help/roles.html @@ -0,0 +1,43 @@ +

    Roles

    + +

    +A role is a collection of permissions defined for the whole site +that you can assign to specific users in specific contexts. +

    + +

    +For example, you may have a Role called "Teacher" that is set up to +allow teachers to do certain things (and not others). Once this role +exists, you can assign it to someone in a course to make them a "Teacher" +for that course. You could also assign the role to a user in the +course category to make them a "Teacher" for all the courses under that +category, or assign the role to a user just in a single forum, giving +that user those capabilities just in that forum. +

    + +

    +A role must have a name. If you need to name the role for multiple +languages you can use multilang syntax if you wish, such as

    +  <span lang="en">Teacher</span> 
    +  <span lang="es_es">Profesor</span> 
    +  
    If you do this make sure the setting to "filter strings" is on for your installation. +

    + +

    +The shortname is necessary for other plugins in Moodle that may need +to refer to your Roles (eg when uploading users from a file or setting +enrolments via an enrolment plugin). +

    + +

    +The description is simply to describe the role in your own words, so +that everyone has a common understanding about the role. +

    + +

    +See also +Contexts, +Permissions, +Assign Roles and +Overrides. +

    diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index 7e93a5e4e7..66e247ed81 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -229,13 +229,19 @@ body#admin-index .copyright { #admin-roles-manage .rolecap .cap-desc .cap-name, #admin-roles-override .rolecap .cap-desc .cap-name { - font-size: 75%; + font-size: 0.75em; } #adminsettings .form-shortname { - font-size: 75%; + font-size: 0.75em; } +#admin-roles-override .cell.c1, +#admin-roles-assign .cell.c1 { + font-size: 0.7em; +} + + /*** *** Blocks ***/ diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 61296910a3..54e3576c6e 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -69,6 +69,11 @@ h6.main { display:block; } +.clearfix { + min-width: 0; + overflow: hidden; +} + .clearfix:after { /* content: ""; */ content: "."; @@ -399,16 +404,12 @@ form.mform div.error,form.mform fieldset.error { } .navbar { - width:100%; + width:auto; padding:3px 0.5em; border-width:1px; border-style:solid; } -div.navbar { - width: auto; -} - table.navbar { width: 100%; } @@ -551,7 +552,12 @@ body#admin-roles-manage table.generalbox { #admin-roles-manage .rolecap .cap-desc .cap-name, #admin-roles-override .rolecap .cap-desc .cap-name { - display: block; + display: block; +} + +#admin-roles-override .cell.c1, +#admin-roles-assign .cell.c1 { + padding-top: 0.75em; } #adminsettings fieldset { @@ -664,9 +670,9 @@ a.skip-block, .skip-block { ul.list, ul.list li, ol.list, ol.list li { list-style-type:none; - padding:0%; - margin:0%; - text-indent:0%; + padding:0; + margin:0; + text-indent:0; } .sideblock .content h3, @@ -675,8 +681,8 @@ ul.list, ul.list li, ol.list, ol.list li { } /*.sideblock .content h3, ??*/ .sideblock .content h2 { - margin:0%; - padding:0%; + margin:1.5em 0 0; + padding:0; } .sideblock { @@ -686,7 +692,7 @@ ul.list, ul.list li, ol.list, ol.list li { .sideblock .header, .sideblock h2.header { text-align: left; - margin:0%; + margin:0; padding:4px; padding-top:0; border-width: 1px; @@ -694,8 +700,8 @@ ul.list, ul.list li, ol.list, ol.list li { border-bottom: none; } .sideblock h2 { - margin:0%; - padding:0%; + margin:0; + padding:0; } .sideblock .header .hide-show { @@ -1189,7 +1195,7 @@ body#course-view .unread { margin-left: 3em; } -body#course-view.editing .sideblock .header { +body#course-view.drag .sideblock .header { cursor: move; } -- 2.39.5