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

Managing roles: Difference between revisions

From MoodleDocs
No edit summary
(Manage roles, Allow role assignments, Allow role overrides, Allow role switches)
 
(56 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{Roles}}
{{Roles}}
Location: ''Administration > Users > Permissions > Define roles''
An administrator can manage roles in  ''Settings > Site administration > Users > Permissions > Define roles''.


Moodle comes with 7 predefined roles:
==Manage roles==


*Administrator
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).
*[[Course creator]]
*[[Teacher]]
*[[Teacher#Non-editing teacher| Non-editing teacher]]
*[[Student]]
*[[Guest access|Guest]]
*Authenticated user (from 1.8 onwards)


Each role may be edited via the link next to its name.
[[Image:Manageroles2.png]]


To edit a role:
#Go to ''Settings > Site administration > Users > Permissions > Define roles''.
#Click the edit icon opposite the role you want to edit e.g. student.
#On the edit role page, change permissions as required for each capability.
#Scroll to the bottom of the page and click the "Save changes" button.


==Permissions==
See [[Creating custom roles]] for information about adding a new role.


Permissions are settings for specific capabilities. There are four values:
==Allow role assignments==


;Not Set (formerly Inherit)
The 'Allow role assignments' tab is for setting which roles each role can assign other users to.
: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 (e.g. in a course) that has this permission for a capability, then the actual permission they'll have will just be the same as they already had at higher-level contexts (e.g. categories or site level). Ultimately, if permission is never allowed at any level, then the user will have no permission for that capability.  


;Allow
[[File:Allowroleassignments.png]]
: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
===Enabling teachers to assign other teachers===
: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.
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:


;Prohibit
#Click on ''Settings > Site administration > Users > Permissions > Define roles''.
: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 site context.  
#Click the Allow role assignments tab.
#Click the checkbox where the teacher row and column intersect.
#Click the "Save changes" button.


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.
==Allow role overrides==


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 look up the context tree for a "decider".
The 'Allow role overrides' tab is for setting which roles can be overridden by each role. Note that the settings only apply to users who have the capabilities [[Capabilities/moodle/role:override|moodle/role:override]] or [[Capabilities/moodle/role:safeoverride|moodle/role:safeoverride]] allowed.


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 Prevent by default (because the two settings cancelled each other out, and thus they have no permission).
==Allow role switches==


==Legacy role types==
The 'Allow role switches' tab is for setting which roles a user may switch to, based on which roles they already have. In addition to an entry in this table, a user must also have the moodle/role:switchroles capability to be able to switch.
 
* Legacy role types were implemented for backward compatibility.
* Selecting a legacy role type in 1.8 (or allowing a legacy capability in 1.7) does NOT provide a new role with all capabilities of a pre-Moodle 1.7 role.
*It is recommended that a legacy role type is selected only for roles that are similar to pre-Moodle 1.7 student/teacher/admin/creator roles.
* It is not necessary to select a legacy role type unless using old 3rd party code that was not designed for Moodle 1.7 and doesn't yet support roles.
 
==Adding a new role==
 
#Give the role an appropriate 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).
#Optional: Give the role a description so that everyone has a common understanding of it.
 
==Creating a duplicate role==
{{Moodle 1.8}}
In Moodle 1.8 onwards, a new role based on a predefined role may be quickly created using the "Duplicate role" button.
#Follow the link of the name of the predefined role to be duplicated.
#Click the "Duplicate role" button near the top of the "View role details" page.
#Answer '''Yes''' to the question "Are you sure you want to duplicate the role ...?"
 
==Testing a new role==
 
#Create test user and assign new role to them.
#Either logout as admin and then login as test user or use a different browser to login as test user.
 
Note: New roles may not be tested using the "Switch role to..." feature.
 
==Example roles==
 
*[[Inspector role|Inspector]] - for providing external inspectors with permission to view all courses (without being required to enrol)
*[[Parent role|Parent]] - for providing parents/mentors/tutors with permission to view certain information about their children/mentees/tutees
*[[Demo teacher role|Demo teacher]] - for providing a demonstration teacher account with a password which can't be changed
*[[Forum moderator role]] - for providing a user with permission in a particular forum to edit or delete forum posts, split discussions and move discussions to other forums
 
==See also==
 
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=66782 What happens if a user has multiple roles in a course?] forum discussion
 
[[Category:Administrator]]
[[Category:Roles]]


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

Latest revision as of 14:52, 20 October 2011


An administrator can manage roles in Settings > Site administration > Users > Permissions > Define 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).

Manageroles2.png

To edit a role:

  1. Go to Settings > Site administration > Users > Permissions > Define roles.
  2. Click the edit icon opposite the role you want to edit e.g. student.
  3. On the edit 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.

Allow role assignments

The 'Allow role assignments' tab is for setting which roles each role can assign other users to.

Allowroleassignments.png

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 Settings > 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 is for setting which roles can be overridden by each role. Note that the settings only apply to users who have the capabilities moodle/role:override or moodle/role:safeoverride allowed.

Allow role switches

The 'Allow role switches' tab is for setting which roles a user may switch to, based on which roles they already have. In addition to an entry in this table, a user must also have the moodle/role:switchroles capability to be able to switch.