Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: Assign roles.

Assign roles: Difference between revisions

From MoodleDocs
(removed template)
 
(24 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Roles}}
{{Roles}}
==Context and roles==
==Context and roles==


*In Moodle,  apart from the site administrator, users do not normally have a global, site-wide role. In other words, even though you may be a tutor offline, when you are in Moodle you could have a tutor role in the course you teach in but a student role in another course where you are studying for a diploma. There are a few exceptions but this is generally the case.
*Apart from the manager and course creator, users do not normally have a site-wide (or system) role. Even though you may be a teacher offline, when you are in Moodle you could have a teacher role in the course you teach in but a student role in another course where you are studying for a diploma.  
*Because of the way Moodle works,assigning roles is done for a particular context. A site and course are examples of two different contexts. When you create a new role or tweak a pre-existing role via ''Site Administration>Settings>Users>Permissions>Define roles'', you are asked in which context(s)you want the role to be assigned:
*Because of the way Moodle works, assigning roles is done for a particular context. A site and course are examples of two different contexts. When you create a new role or tweak a pre-existing role via ''Administration > Site Administration > Users > Permissions > Define roles'', you are asked in which context(s) you want the role to be assigned:
[[File:rolecontexttypes.png]]
[[File:rolecontexttypes.png]]


Line 10: Line 9:


===System context===
===System context===
*''Settings>Site Administration>Users>Permissions>Assign system roles''
 
*Any roles assigned here apply to the whole Moodle site. It makes sense therefore that only roles that need this functionality can be assigned here. The [[Manager]] role and [[Course creator]] role are examples of two such roles. Assigning a teacher or student here would result in their being able to teach/study in every single course on the site, which is not usually desirable.  
To assign a role in the system context, go to Site administration > Users > Permissions > 'Assign system roles'.
*If you really feel your Moodle needs to have teachers or students assigned in the system context, go to the teacher/student role in ''Settings > Site administration > Users > Permissions > Define roles'' and check the "system" box.
 
Any roles assigned here apply across the whole site. It makes sense therefore that only roles that need this functionality can be assigned here. The [[Manager]] role and [[Course creator]] role are examples of two such roles. Assigning a teacher or student here would result in their being able to teach/study in every single course on the site, which is not usually desirable.  
 
=====Assigning system roles by CSV=====
 
Where certain custom roles are applied in the system context, it is possible to upload users to that role in bulk by adding the field ''sysrole1'' (etc) to a CSV file.
 
[[File:GlobalRoles1.png|thumb|500px|center|sysrole column]]
 
When previewed, there is a column indicating their system role:
 
[[File:GlobalRoles2.png|thumb|center|500px|Preview screen]]
 
Once uploaded, the users are present on the 'Assign system roles' screen:
 
[[File:GlobalRoles3.png|thumb|center|500px|Assign system roles screen]]
 
See [[Upload users]] for information on adding users to roles via CSV.


===Front page context===
===Front page context===
*Settings>Site Administration>Front Page>Front Page roles
*''Administration > Site Administration > Front Page>Users>Permissions>Assigned roles
*Those with a role in the system context do not need to be assigned a role here as well.
*Those with a role in the system context do not need to be assigned a role here as well.
*However you might want to allow a teacher to manage items on the front page; in this instance, you would assign them the role on the Front page.
*However you might want to allow a teacher to manage items on the front page; in this instance, you would assign them the role on the Front page.
===Course Category context===
===Course Category context===
*See [[Category enrolments]]
*See [[Category enrolments]] - users may be enrolled in the category to save enrolling them in each individual course in that category.
*Users may be enrolled in the category to save enrolling them in each individual course in that category.
*See also [[Manager_role#Assigning_the_role_of_Manager_at_the_Category_level | Assign Manager role at category level]].


===Course context===
===Course context===
*''Settings>Course administration>Enrolled users''
[[File:enrolusers.png|thumb|Enrol users]]
*Click the "Enrol users" button and click those users you wish to enrol.
* Go to the Participants page
*The dropdown menu at the top shows roles for which you are allowed to enrol; typically those users with lower roles than you.
* Click the "Enrol users" button and click those users you wish to enrol
[[File:enrolusers.png]]
 
The dropdown menu at the top shows roles for which you are allowed to enrol; typically those users with lower roles than you. See [[Participants]] for more details.


===Block context===
===Block context===
*(Within the block) ''Settings>Assign roles''
*(Within the block) ''Administration > Assign roles''
*You may wish to assign roles to a block if, for instance you want specific people to see the block but for it to be hidden from others
*You may wish to assign roles to a block if, for instance you want specific people to see the block but for it to be hidden from others


=== Activity Module context===
=== Activity Module context===
*(Within the activity settings) ''Settings>Locally assigned roles''
*(Within the activity settings) ''Administration > Locally assigned roles''
*An example of this is assigning a student the teacher role locally in an individual activity like a forum so they can moderate their classmates' posts while still retaining the student role in the rest of the course.
*An example of this is assigning a student the teacher role locally in an individual activity like a forum so they can moderate their classmates' posts while still retaining the student role in the rest of the course.


===User context===
===User context===
*The most common use of this is for the Parent role.
*When the Parent role is created via''Settings > Site administration > Users > Permissions > Define roles'' the "user" context box is checked.
*To assign a parent the role in the context of their child (so they can see their child's grades etc) click the child's profile and then go to ''Settings>Roles>Assign roles relative to this user''
*See [[Parent role]] for more information.


The assign roles page lists the names of users assigned to each role (unless there are more than 10 users, in which case this is stated).
The user context is used for roles such as mentor, team leader or the [[Parent role]]. The role to be assigned must have 'User' ticked as the context type where it is to be assigned.
 
To assign a user the role of mentor in the context of their mentee, click the mentee's profile, then Preferences then 'Assign roles relative to this user'.
 
If a mentor has lots of mentees, the role of mentor can be assigned to them all in one go as follows:
 
# Put all mentees in a cohort
# Go to ''Site administration > Users > Permissions > Assign user roles to cohort''


==Hierarchy==
==Hierarchy==
Line 62: Line 83:
Roles will only work if the role assignment is made in the correct context. Some examples: a Teacher role should be assigned to a user in the course or course category context, a Forum moderator for a particular forum should be assigned in that specific forum.
Roles will only work if the role assignment is made in the correct context. Some examples: a Teacher role should be assigned to a user in the course or course category context, a Forum moderator for a particular forum should be assigned in that specific forum.


==Assigning someone the role of Site Administrator==
==Assigning someone the role of Site administrator==
*Although this is a system role, the site administrator role cannot be assigned via ''Settings>Site Administration>Users>Permissions>Assign system roles'' because it would be too easy to mistakenly enrol or unenrol administrators and be left with nobody in charge of your Moodle.
 
*For this reason, administrators are assigned via a special page: ''Settings>Site Administratration>Users>Permissions>Site Administrators'' and you are asked to think twice before you give someone this role. Select the name from the right and move it over to the left:
*Site administrators are assigned via a special page: ''Administration > Site Administration > Users > Permissions > Site Administrators''. Select the name from the right and move it over to the left:
[[File:managesiteadmins.png]]
[[File:managesiteadmins.png]]
*Note also that the original (primary) administrator cannot be deleted.
*The original (primary) administrator cannot be deleted.
 
==Checking a user's role assignments==
 
To check a user's role assignments go to their profile page, then under the Administration heading, click on 'Preferences'. On the Preferences page, under the 'Roles' heading click on 'This user's role assignments'.


==Hidden roles==
==Hidden roles==


If you want to provide users with access to the course, but don't want them to be visible in the participants list, use the "other users" link in the course administration menu (''Course Administration > Users > Other Users''). Assigning roles here provides course access, and editing rights according to the permissions set for the role assigned without actually enrolling the user in the course. This is similar to the functionality of the "hidden user" check box in previous versions of Moodle.
If you want to provide users with access to the course, but don't want them to be visible in the participants list, use the [[Other users]] link in the course administration menu (''Administration > Course Administration > Users > Other Users''). Assigning roles here provides course access, and editing rights according to the permissions set for the role assigned without actually enrolling the user in the course. This is similar to the functionality of the "hidden user" check box in previous versions of Moodle.
 
Note: By default, the only role which can be assigned to other users is the manager role. To enable other roles, such as teacher to be assigned, the capability [[Capabilities/moodle/course:view|moodle/course:view]] should be allowed for the role (see below).


==Enabling teachers to assign the role of teacher==
==Enabling teachers to assign the role of teacher==
Line 76: Line 103:
By default, teachers are only allowed to assign the roles of non-editing teacher, student and guest. To enable teachers to assign the role of teacher:
By default, teachers are only allowed to assign the roles of non-editing teacher, student and guest. To enable teachers to assign the role of teacher:


#Access ''Administration > Users > Permissions > Define roles''.
#Access ''Site Administration > Users > Permissions > Define roles''.
#Click the tab "Allow role assignments".
#Click the tab "Allow role assignments".
#Click the checkbox where the teacher row and column intersect.
#Click the checkbox where the teacher row and column intersect.
Line 88: Line 115:


A significant part of the roles infrastructure is the ability to assign a user into multiple roles (at the same time). The capabilities of each role are merged to produce the effective set of capabilities. For example, a user could be  both a Teacher and Student in the same course. You should be careful to ensure that if you change a user's role that you remove them from any other roles as required as this will no longer be done automatically.
A significant part of the roles infrastructure is the ability to assign a user into multiple roles (at the same time). The capabilities of each role are merged to produce the effective set of capabilities. For example, a user could be  both a Teacher and Student in the same course. You should be careful to ensure that if you change a user's role that you remove them from any other roles as required as this will no longer be done automatically.


==See also==
==See also==
Line 100: Line 126:
*[http://moodle.org/mod/forum/discuss.php?d=66782 What happens if a user has multiple roles in a course?]
*[http://moodle.org/mod/forum/discuss.php?d=66782 What happens if a user has multiple roles in a course?]


[[Category:Teacher]]
[[Category:Roles]]
[[Category:Roles]]


[[cs:Přidělení rolí]]
[[de:Rollen zuweisen]]
[[de:Rollen zuweisen]]
[[es:Asignar_roles]]
[[es:Asignar_roles]]
[[eu:Rolak_esleitu]]
[[eu:Rolak_esleitu]]
[[fr:Attribuer des rôles]]
[[fr:Attribution des rôles]]
[[ja:ロールの割り当て]]
[[ja:ロールの割り当て]]
[[ru:Назначение ролей]]

Latest revision as of 08:10, 11 April 2019


Context and roles

  • Apart from the manager and course creator, users do not normally have a site-wide (or system) role. Even though you may be a teacher offline, when you are in Moodle you could have a teacher role in the course you teach in but a student role in another course where you are studying for a diploma.
  • Because of the way Moodle works, assigning roles is done for a particular context. A site and course are examples of two different contexts. When you create a new role or tweak a pre-existing role via Administration > Site Administration > Users > Permissions > Define roles, you are asked in which context(s) you want the role to be assigned:

rolecontexttypes.png

  • Here are some examples of contexts; how to get to the assign roles screen, and when/why you would assign roles here:

System context

To assign a role in the system context, go to Site administration > Users > Permissions > 'Assign system roles'.

Any roles assigned here apply across the whole site. It makes sense therefore that only roles that need this functionality can be assigned here. The Manager role and Course creator role are examples of two such roles. Assigning a teacher or student here would result in their being able to teach/study in every single course on the site, which is not usually desirable.

Assigning system roles by CSV

Where certain custom roles are applied in the system context, it is possible to upload users to that role in bulk by adding the field sysrole1 (etc) to a CSV file.

sysrole column

When previewed, there is a column indicating their system role:

Preview screen

Once uploaded, the users are present on the 'Assign system roles' screen:

Assign system roles screen

See Upload users for information on adding users to roles via CSV.

Front page context

  • Administration > Site Administration > Front Page>Users>Permissions>Assigned roles
  • Those with a role in the system context do not need to be assigned a role here as well.
  • However you might want to allow a teacher to manage items on the front page; in this instance, you would assign them the role on the Front page.

Course Category context

Course context

Enrol users
  • Go to the Participants page
  • Click the "Enrol users" button and click those users you wish to enrol

The dropdown menu at the top shows roles for which you are allowed to enrol; typically those users with lower roles than you. See Participants for more details.

Block context

  • (Within the block) Administration > Assign roles
  • You may wish to assign roles to a block if, for instance you want specific people to see the block but for it to be hidden from others

Activity Module context

  • (Within the activity settings) Administration > Locally assigned roles
  • An example of this is assigning a student the teacher role locally in an individual activity like a forum so they can moderate their classmates' posts while still retaining the student role in the rest of the course.

User context

The user context is used for roles such as mentor, team leader or the Parent role. The role to be assigned must have 'User' ticked as the context type where it is to be assigned.

To assign a user the role of mentor in the context of their mentee, click the mentee's profile, then Preferences then 'Assign roles relative to this user'.

If a mentor has lots of mentees, the role of mentor can be assigned to them all in one go as follows:

  1. Put all mentees in a cohort
  2. Go to Site administration > Users > Permissions > Assign user roles to cohort

Hierarchy

By assigning a role to a user in a certain context, you grant them the permissions contained in that role for the current context and all lower contexts.

The list of contexts in hierarchical order is as follows:

  • System (no parent)
  • Front page (parent = system) -
  • Course category (parent = parent category or system)
  • Course (parent = category or system)
  • Module (parent = course or system)
  • Block (parent = course or system)
  • User (parent = system)

Roles can be inherited. For example if a user is assigned a Teacher role in a specific course category then the user will have this role in ALL courses within the category. Tip: use the override feature in a specific context for exceptions.

Roles will only work if the role assignment is made in the correct context. Some examples: a Teacher role should be assigned to a user in the course or course category context, a Forum moderator for a particular forum should be assigned in that specific forum.

Assigning someone the role of Site administrator

  • Site administrators are assigned via a special page: Administration > Site Administration > Users > Permissions > Site Administrators. Select the name from the right and move it over to the left:

managesiteadmins.png

  • The original (primary) administrator cannot be deleted.

Checking a user's role assignments

To check a user's role assignments go to their profile page, then under the Administration heading, click on 'Preferences'. On the Preferences page, under the 'Roles' heading click on 'This user's role assignments'.

Hidden roles

If you want to provide users with access to the course, but don't want them to be visible in the participants list, use the Other users link in the course administration menu (Administration > Course Administration > Users > Other Users). Assigning roles here provides course access, and editing rights according to the permissions set for the role assigned without actually enrolling the user in the course. This is similar to the functionality of the "hidden user" check box in previous versions of Moodle.

Note: By default, the only role which can be assigned to other users is the manager role. To enable other roles, such as teacher to be assigned, the capability moodle/course:view should be allowed for the role (see below).

Enabling teachers to assign the role of teacher

By default, teachers are only allowed to assign the roles of non-editing teacher, student and guest. To enable teachers to assign the role of teacher:

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

Beware of assignments that don't make sense

There are many role assignments that do not make sense as the underlying functionality does not exist. Just because you give someone the "right" to do something does not guarantee that the interface or facility actually exists within the context that you have assigned that right. For example, you can assign a user the right to create new categories in the category context. However there is no interface within Moodle to do that (category creation is only available at the system level).

Multiple assignments

A significant part of the roles infrastructure is the ability to assign a user into multiple roles (at the same time). The capabilities of each role are merged to produce the effective set of capabilities. For example, a user could be both a Teacher and Student in the same course. You should be careful to ensure that if you change a user's role that you remove them from any other roles as required as this will no longer be done automatically.

See also

Using Moodle forum discussions: