Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: Managing roles.

Managing roles: Difference between revisions

From MoodleDocs
(updated for 2.0)
 
(29 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Roles and capabilities}}
{{Roles}}
Location: ''Site administration > Users > Permissions > Define roles''
Managing overall role capabilities can be done by an administrator using  ''Administration > Site administration > Users > Permissions > Define roles''.  This is the place to add custom roles or modify existing roles.  The "Manage roles" tab, allows the system administrator to edit any one of over 350 different capabilities associated with any role.  The "Allow role assignments", "Allow role overrides" and "Allow role switches" contain a matrix which give the ability for a specific role to work with other specific roles.


The define roles page has four tabs, for managing roles, [[Allow role assignments|allowing role assignments]] [[Allow role overrides|allowing role overrides]] and allowing role switches.
==Manage roles==


The manage roles tab contains a list of roles on your site. The edit column contains icons for editing, deleting roles and copying roles, and for moving them up or down in the list (affecting the way that roles are listed around Moodle).
The 'Manage roles' tab contains a list of roles on your site. The edit column contains icons for editing, deleting roles and copying roles, and for moving them up or down in the list (affecting the way that roles are listed around Moodle).


[[Image:Allowroletoview.png]]


==Predefined roles==
Moodle comes with 7 predefined roles:
*[[Administrator role|Administrator]]
*[[Manager role|Manager]]
*[[Course creator role|Course creator]]
*[[Teacher role|Teacher]]
*[[Teacher role| Non-editing teacher]]
*[[Student role|Student]]
*[[Guest role|Guest]]
*[[Authenticated user role|Authenticated user]]
*[[Authenticated user on the front page role|Authenticated user on the front page]]
==Editing a role==
[[Image:Manageroles2.png|thumb|Managing roles]]
To edit a role:
To edit a role:
#Go to ''Settings>Site administration>Users>Permissions>Define roles''.
#Go to ''Administration > Site administration > Users > Permissions > Define roles''.
#Click the edit icon opposite the role you want to edit e.g. student.
#Click the edit icon opposite the role you want to edit. For example "student".
#On the edit role page, change permissions as required.
#On the editing role page, change permissions as required for each capability.
#Scroll to the bottom of the page and click the "Save changes" button.
#Scroll to the bottom of the page and click the "Save changes" button.


==Adding a new role==
See [[Creating custom roles]] for information about adding a new role and creating a duplicate role.
 
To add a new role:
#Go to ''Settings>Site Administration>Users>Permissions>Define roles''.
#Click the "Add a new role" button.
#On the add a new role page, give the role a name. If you need to name the role for multiple languages you can use [[Multi language content|multi-lang syntax]] if you wish, such as <code><nowiki><span lang="en" class="multilang">Teacher</span> <span lang="es_es" class="multilang">Profesor</span></nowiki></code>. If multi-lang syntax is used then ''Filter all strings'' should be set in [[Filter settings]].
#Give the role a meaningful short name. The short name is necessary for other plugins in Moodle that may need to refer to the role (e.g. when uploading users from a file or setting enrolments via an enrolment plugin).
#Give the role a description (optional).
#Set permissions as required.
#Scroll to the bottom of the page and click the "Create this role" button.
 
==Creating a duplicate role==
 
To create a duplicate role:
#Go to ''Settings>Site Administration>Users>Permissions>Define roles''.
#In the "edit" column on the right, click the  "Create a new role by copying" button.
#Give a name and set permissions for your new role; scroll down and click "create this role".
#The list of roles will now show the "... copy 1" at the bottom, for example "Guest copy 1".
 
==Permissions==
 
There are four settings for each capability:
 
;Not Set
:This is the default value for all permissions when a new role is created.
 
:Note that if a capability is left as "Not Set," the resulting behavior is that of '''Prevent''', unless otherwise allowed by another role at a higher context. For example, if you mark Not Set for the permission of a Student to Add New Discussions in a forum, they will not be allowed to do so unless they also hold the role of Teacher, Course Creator, or another higher role for which that capability ''is'' allowed.


;Allow
==Role name localisation==
: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" contexts. For example, if this role is a student role assigned to a course, then students will be able to "start new discussions" in all forums in that course, unless some forum contains an override or a new assignment with a Prevent or Prohibit value for this capability.


;Prevent
If a standard role name or description is empty Moodle uses a default string from the current language pack. Custom roles can be customised using multilang syntax.
: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
You may also override the role names separately in each course.
: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. An example of when you might need this is when an admin wants to prohibit one person from starting new discussions in any forum on the whole site. In this case they can create a role with that capability set to "Prohibit" and then assign it to that user in the system context.


==Role archetypes==
==Resetting a role==


A role archetype may be set. If the role is then reset to default, appropriate permissions are set. Thus it provides an alternative method to creating a duplicate of a default role.
To reset a role back to the default permissions:
#Go to ''Administration > Site administration > Users > Permissions > Define roles''.
#Click on the name of the role, for example "student".
#Click the 'Reset' button.


If new capabilities are added in future versions of Moodle, the role archetype setting determines any new permissions for the role when the site is upgraded.
Note that if you have students who have been given extra permissions at course and/or activity levels (such as forum ratings), then they will no longer be able to do this once the role has been reset to its default. A teacher would need to go back and set up these extra permissions in the course/activity levels again.


==New role considerations==
==Allow role assignments==


A newly-created role does not have the ability to assign or override any other roles. This is true even when the new role is a copy of a role that had such abilities.  If such ability is needed, the administrator must grant it explicitly (Site administration -> Users -> Permissions -> Define roles ->  Allow role assignments and Allow role overrides tab).
The "Allow role assignments" tab allows (or does not allow) a specific role to be able to assign specific roles to a user.


A new role is not automatically listed in course descriptions even if was created by copying a role that is listed, such as [[Teacher]]. If you want the new role to appear in the course listing, you must set it explicitly via ''Administration > Appearance > [[Course managers]]''.


==Testing a new role==
===Enabling teachers to assign other teachers===
''Settings > Switch role to''
By default, teachers can only assign other users the roles of non-editing teachers, students and guests. If you want teachers to be able to assign other teachers in their course, you can allow the role assignment:
Use the "Switch role to" link to see what another role will see in that context. 


Since switching roles confines you to those roles you can assign in a course context, this method is only useful for testing course-scoped capabilities (i.e., it will not be useful for testing permissions that apply outside the course context, like moodle/user:edit).
#Click on ''Administration > Site administration > Users > Permissions > Define roles''.
#Click the Allow role assignments tab.
#Click the checkbox where the teacher row and column intersect.
#Click the "Save changes" button.


''Tip:'' You can always create test user and assign the new role to them.  Then logout as admin and login as the test user.  This is really the best way to test a new role.
==Allow role overrides==
The "Allow role overrides" tab allows (or does not allow) a specific role to be able to override specific roles for a user.  For example, it might allow a teacher role to override a student's role to a non-editing teacher's role.  


==Example roles==
:Note that the settings only apply to roles that have the capabilities [[Capabilities/moodle/role:override|moodle/role:override]] or [[Capabilities/moodle/role:safeoverride|moodle/role:safeoverride]] allowed.


*[[Inspector role|Inspector]] - for providing external inspectors with permission to view all courses (without being required to enrol)
==Allow role switches==
*[[Parent role|Parent]] - for providing parents/mentors/tutors with permission to view certain information about their children/mentees/tutees
The "Allow role switches" tab allows (or does not allow) a specific role to be able to temporarily change their role to another specific role.  For example, this might allow a users assigned to a custom role in a course to see "Student" in the Settings > Switch role list. 
*[[Demo teacher role|Demo teacher]] - for providing a demonstration teacher account with a password which can't be changed
*[[Forum moderator role|Forum moderator]] - for providing a user with permission in a particular forum to edit or delete forum posts, split discussions and move discussions to other forums
:Note: the selected role must also have the moodle/role:switchroles capability to be able to switch.
*[[Calendar editor role|Calendar editor]] - for enabling a user to add site or course events to the calendar
*[[Blogger role|Blogger]] - for limiting blogging to specific users only
*[[Quiz user with unlimited time role|Quiz user with unlimited time]] - for allowing a user unlimited time to attempt a quiz which has a time limit set
*[[Question creator role|Question creator]] - for enabling students to create questions for use in quizzes
*[[Keyholder role]] - someone who manages the [[Enrolment key]] in courses
*[[Course requester role]] - for restricting users who can make course requests


==See also==
==Allow role to view==


* [[How permissions are calculated ]]
'''New in 3.5:''' This setting allows the administrator to decide which roles users can see, search and filter by, according to their existing role.
* [[The rolesdebug.php roles debugging script]] (a contributed script)
* [[Useful things a teacher can do with roles]]


Using Moodle forum discussions:
==Roles capabilities==


* [http://moodle.org/mod/forum/discuss.php?d=66782 What happens if a user has multiple roles in a course?]
*[[Capabilities/moodle/role:manage|Create and manage roles]]
* [http://moodle.org/mod/forum/discuss.php?d=90140 logged in: what role am I?]
*[[Capabilities/moodle/role:assign|Assign roles to users]]
*[[Capabilities/moodle/role:switchroles|Switch to other roles]]


[[Category:Administrator]]
[[Category:Site administration]]


[[es:Gestionar_roles]]
[[es:Gestionar_roles]]
[[eu:Rolak_kudeatu]]
[[eu:Rolak_kudeatu]]
[[fr:Définir les rôles]]
[[fr:Gestion des rôles]]
[[ja:ロールの管理]]
[[ja:ロールの管理]]
[[de:Rollen verwalten]]
[[de:Rollen verwalten]]

Latest revision as of 15:39, 27 July 2018


Managing overall role capabilities can be done by an administrator using Administration > Site administration > Users > Permissions > Define roles. This is the place to add custom roles or modify existing roles. The "Manage roles" tab, allows the system administrator to edit any one of over 350 different capabilities associated with any role. The "Allow role assignments", "Allow role overrides" and "Allow role switches" contain a matrix which give the ability for a specific role to work with other specific roles.

Manage roles

The 'Manage roles' tab contains a list of roles on your site. The edit column contains icons for editing, deleting roles and copying roles, and for moving them up or down in the list (affecting the way that roles are listed around Moodle).

Allowroletoview.png

To edit a role:

  1. Go to Administration > Site administration > Users > Permissions > Define roles.
  2. Click the edit icon opposite the role you want to edit. For example "student".
  3. On the editing role page, change permissions as required for each capability.
  4. Scroll to the bottom of the page and click the "Save changes" button.

See Creating custom roles for information about adding a new role and creating a duplicate role.

Role name localisation

If a standard role name or description is empty Moodle uses a default string from the current language pack. Custom roles can be customised using multilang syntax.

You may also override the role names separately in each course.

Resetting a role

To reset a role back to the default permissions:

  1. Go to Administration > Site administration > Users > Permissions > Define roles.
  2. Click on the name of the role, for example "student".
  3. Click the 'Reset' button.

Note that if you have students who have been given extra permissions at course and/or activity levels (such as forum ratings), then they will no longer be able to do this once the role has been reset to its default. A teacher would need to go back and set up these extra permissions in the course/activity levels again.

Allow role assignments

The "Allow role assignments" tab allows (or does not allow) a specific role to be able to assign specific roles to a user.


Enabling teachers to assign other teachers

By default, teachers can only assign other users the roles of non-editing teachers, students and guests. If you want teachers to be able to assign other teachers in their course, you can allow the role assignment:

  1. Click on Administration > Site administration > Users > Permissions > Define roles.
  2. Click the Allow role assignments tab.
  3. Click the checkbox where the teacher row and column intersect.
  4. Click the "Save changes" button.

Allow role overrides

The "Allow role overrides" tab allows (or does not allow) a specific role to be able to override specific roles for a user. For example, it might allow a teacher role to override a student's role to a non-editing teacher's role.

Note that the settings only apply to roles that have the capabilities moodle/role:override or moodle/role:safeoverride allowed.

Allow role switches

The "Allow role switches" tab allows (or does not allow) a specific role to be able to temporarily change their role to another specific role. For example, this might allow a users assigned to a custom role in a course to see "Student" in the Settings > Switch role list.

Note: the selected role must also have the moodle/role:switchroles capability to be able to switch.

Allow role to view

New in 3.5: This setting allows the administrator to decide which roles users can see, search and filter by, according to their existing role.

Roles capabilities