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

Managing roles: Difference between revisions

From MoodleDocs
(roles capabilities)
 
(74 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{Roles}}
{{Roles}}
{{Moodle 1.7}}
Managing overall role capabilities can be done by an administrator using  ''Settings > 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.  


Location: ''Administration > Users > Permissions > Define roles''
==Manage roles==


From Moodle 1.7 onwards administrators may choose to add or edit 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).


==Predefined roles==
[[Image:Manageroles2.png]]


Moodle comes with 7 predefined roles:
To edit a role:
#Go to ''Settings > Site administration > Users > Permissions > Define roles''.
#Click the edit icon opposite the role you want to edit. For example "student".
#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.


*Administrator
See [[Creating custom roles]] for information about adding a new role and creating a duplicate role.
*[[Course creator]]
*[[Teacher]]
*Non-editing teacher
*[[Student]]
*[[Guest access|Guest]]
*Authenticated user (1.8)


Each role may be edited via the link next to its name.
==Resetting a role==
{{Moodle 1.8}}
Role permissions may be reset or a duplicate role created using the buttons at the top of the View role details page (from Moodle 1.8 onwards).


==Permissions==
To reset a role back to the default permissions:
The permissions matrix allows a very granular approach to assigning rights to a role (a class of users). Assigning or editing permissions should be done with great care.  A change can produce a profound unwanted effect, or an annoying effect that will be hard to understand the cause.
#Go to ''Settings > Site administration > Users > Permissions > Define roles''.
#Click on the name of the role, for example "student".
#Click the 'Reset to defaults' button.


There are over 150 lines of capabilities where any of 4 different permissions can be assigned.  The capabilities are grouped in 21 categories.
==Allow role assignments==
[[Image:Roles_Define_Permissions_crop.JPG|frame|center|Top of the permissions table]]


The permissions for each of the pre-defined roles are shown with a grey background (from Moodle 1.8 onwards).
The "Allow role assignments" tab allows (or does not allow) a specific role to be able to assign specific roles to a user.


===Permission terms===
[[File:Allowroleassignments.png]]
From lowest to highest, from general to specific.


*Inherit - pass along from before [lowest level, always loses]
===Enabling teachers to assign other teachers===
*Allow - let happen or permit [same level as prevent]
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:
*Prevent - stop [same level as allow]
*Prohibit - forbid [highest level, always wins]


===Permission examples===
#Click on ''Settings > Site administration > Users > Permissions > Define roles''.
'''Inherit''': if no permission is defined, then the capability permission is inherited from a context that is more general than the current context.  
#Click the Allow role assignments tab.
#Click the checkbox where the teacher row and column intersect.
#Click the "Save changes" button.


'''Allow and prevent''' will cancel each other out if set for the same capability at the same context level. If this happens, we refer to the previous context level to determine the permission for the capability.
==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.  


'''Prohibit''': If we set prohibit on a capability, it means that the capability cannot be overridden. Prohibit always wins and creates a permanent stop.  
: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.


Since the capabilities in each role could be different and participants can be assigned different roles,  there could be a conflict in capabilities. The hierarchy of permissions resolves this by saying that the capability defined for a more specific context will win, unless an prohibit is encountered in a less specific context.  
==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.


Example 1. Mark has a student role in Course One, which allows  all students to write into the wikis "Everyone" and "Homework".  But Mark also got assigned a Visitor role at a module context level (for the wiki "Honors") and Visitors are prevented writing in the Honors wiki.  Thus Mark can write into the "Everyone" and "Homework" wikis but not in "Honors".
==Roles capabilities==


Example 2. Jeff has been assigned to a "naughty student" role that prohibits him from postings in any forums for the whole site. However his teacher assigned him a "facilitator" role in "Science forum" in the course Science and Math 101. Since a higher context prohibit permission always wins, Jeff is unable to post in "Science forum".
*[[Capabilities/moodle/role:manage|Create and manage roles]]
*[[Capabilities/moodle/role:assign|Assign roles to users]]
*[[Capabilities/moodle/role:switchroles|Switch to other roles]]


==Legacy capabilities==
[[Category:Site administration]]
 
* Legacy capabilities were implemented for backward compatibility.
* Allowing a legacy capability does NOT provide a new role with all capabilities of a pre-Moodle 1.7 role.
* It is not necessary to to allow any legacy capabilities 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.
 
==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
 
==See also==
*The capability [[Capabilities/moodle/role:manage|moodle/role:manage]]
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=57812 Create a Parent of a student role] forum discussion
*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 08:08, 25 April 2012


Managing overall role capabilities can be done by an administrator using Settings > 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).

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. 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.

Resetting a role

To reset a role back to the default permissions:

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

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.

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 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.

Roles capabilities