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

Assign roles: Difference between revisions

From MoodleDocs
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Roles}}
{{Roles}}
==Context and roles==


==Locations for assigning 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.
*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:
[[File:rolecontexttypes.png]]


[[Image:Assign roles.png|thumb|Assign roles in Moodle 1.9]]
*Here are some examples of contexts; how to get to the assign roles screen, and when/why you would assign roles here:
Assigning roles is done for/in a particular context. A site and course are examples of two different contexts.  While the process is similar for each context, the approach to role assignment page may be different.  Here are several contexts and ways to find the assign roles.


*System context: ''Site Administration > Users > Permissions > Assign system roles'' (this context is named "site" in Moodle 1.7)
===System context===
*Front page context: ''Site Administration > Front Page > Front Page roles'' (in Moodle 1.8 onwards)
*''Settings>Site Administration>Users>Permissions>Assign system roles''
*Course category context: Assign roles link in course categories page
*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.  
*Course context: Assign roles link in course administration block
*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. Then search for and allow the capability [[Capabilities/moodle/course:view|moodle/course:view]]
*Module context: "Locally assigned roles" tab in editing activity page
*Block context: Assign roles link in course block (with editing turned on)
*User context: Roles tab in user profile page


{{Moodle 1.9}}In Moodle 1.9 onwards, 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).
===Front page context===
*Settings>Site Administration>Front Page>Front Page 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===
*See [[Category enrolments]]
*Users may be enrolled in the category to save enrolling them in each individual course in that category.


==Contexts==
===Course context===
[[File:enrolusers.png|thumb|Enrol users]]
* Go to ''Settings > Course administration > Enrolled users''
* 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 [[Enrolled users]] for more details.
 
===Block context===
*(Within the block) ''Settings>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) ''Settings>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 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).
 
==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.
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:
The list of contexts in hierarchical order is as follows:
[[Image:Moodle-contexts-1.8.png|right|thumbnail|200px|A diagram of the contexts in Moodle. Click on the diagram to see a more detailed view of it.]]


*System (no parent)
*System (no parent)
*Site (parent = system) - Moodle 1.8 onwards
*Front page (parent = system) -  
*Course category (parent = system)
*Course category (parent = parent category or system)
*Course (parent = category or system)
*Course (parent = category or system)
*Module (parent = course or system/site(1.8 onwards))
*Module (parent = course or system)  
*Block (parent = course or system/site(1.8 onwards))
*Block (parent = course or system)
*User (parent = system)
*User (parent = system)


Inheritance will kick in if a role is assigned at a higher level. For example if a user is assigned a Teacher role in a particular course category then the user will have this role in ALL courses within the category.
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. For example, a Teacher role should be assigned in the  course or course category context, a Forum moderator for a particular forum should be assigned in the module context.
 
The [[Inspector role]] is an example of a role assigned in the system context. The [[Forum moderator role]] is an example of a role assigned in the module context. The [[Parent role]] is an example of a role assigned in the user context.
 
==Assigning a role==


[[Image:Roles Assign Student.JPG|thumb|Assigning users the role of student i.e. enrolling them on the course]]"Student", "Teacher", "Course Creator" are some of the predefined roles that come with Moodle. The site administrator may have created additional roles.
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.
To assign a role:
#Choose the type of role you wish to assign. For example, if we wanted to assign a Student role to Martin, we'd choose "Student" from the list of roles.
#Once you have chosen a role, two lists appear: a list of users who currently have that role (Student Demo in the example), and a list of users who don't. We can select Martin in the second list, and use the left-facing arrow button to add Martin to the list of Students. Multiple users may be selected by holding down the Apple or Ctrl key whilst clicking on the users' names.


Removing someone from a role is done by moving the user from the left column to the right.
==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:
[[File:managesiteadmins.png]]
*Note also that the original (primary) administrator cannot be deleted.


==Hidden assignments==
==Hidden roles==


To hide which role a user is assigned to, click the Hidden assignments check box before assigning the role to the user. This feature is useful for example if you don't want everyone with teacher rights listed in the course description. This feature is also very useful for hiding system wide roles from everyone else on the site.
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 (''Settings > 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: The role assignment is not hidden from admins or teachers i.e. users with the [[Capabilities/moodle/role:viewhiddenassigns|viewhiddenassigns capability]].
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.


==Enabling teachers to assign the role of teacher==
==Enabling teachers to assign the role of teacher==
Line 64: Line 85:
==Beware of assignments that don't make sense==
==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).
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).
 
Note: Users should only be assigned the role of [[Administrator role|administrator]] (i.e. a role with the capability [[Capabilities/moodle/site:doanything|moodle/site:doanything]] set to allow) in the system context. Users should only be assigned the role of [[Course creator role|course creator]] in the system or a course category context.


==Multiple assignments==
==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. In particular it is perfectly possible for a user to be both a Teacher and Student in the same course. This differs from the behavior of Moodle prior to the introduction of roles. 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.


==System roles==
Roles assigned in the site (1.7) or system context (1.8 onwards) are called system roles and apply across the entire site, including the front page. For example, a user assigned the system role of teacher will have this role in every course on the site.
In many sites only admins and course creators will be assigned system roles.
The [[Blogger role]] is an example of a system role.
==Front page roles==
You can assign roles and set up role overrides for your front page in exactly the same way as for a course.
There are various ways of enabling logged-in users to participate in front page activities, depending on your Moodle version. See the [[Roles FAQ]] for details.
==Assigning a role for a front page activity==
Only users who are assigned front page roles appear in the list of potential users when assigning a role for a front page activity.
To assign a user a role for a front page activity:
# Assign the user a front page role, such as student, in ''Administration > Front Page > Front Page roles''.
# Click the "Locally assigned roles" tab in editing activity page for the front page activity.
# Choose the type of role you wish to assign.
# Use the left-facing arrow button to add a particular user to the list of users with the role.
Note: If a user is unassigned from a front page role AFTER being assigned a role for a front page activity, they remain assigned the role for the front page activity.


==See also==
==See also==
*[[Manage roles]] - for administrators
*[[Creating custom roles]]
*[[Enrolment]]
*[[Managing roles]] - for administrators
*[[Useful things a teacher can do with roles]]
*[[Useful things a teacher can do with roles]]


Line 106: Line 102:
*[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]]
[[es:Asignar_roles]]
[[es:Asignar_roles]]
[[eu:Rolak_esleitu]]
[[fr:Attribuer des rôles]]
[[fr:Attribuer des rôles]]
[[ja:ロールの割り当て]]
[[ja:ロールの割り当て]]
[[ru:Назначение ролей]]
[[de:Rollen zuweisen]]

Latest revision as of 12:42, 6 February 2013


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

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

  • 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.
  • 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. Then search for and allow the capability moodle/course:view

Front page context

  • Settings>Site Administration>Front Page>Front Page 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

  • See Category enrolments
  • Users may be enrolled in the category to save enrolling them in each individual course in that category.

Course context

Enrol users
  • Go to Settings > Course administration > Enrolled users
  • 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 Enrolled users for more details.

Block context

  • (Within the block) Settings>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) Settings>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 most common use of this is for the Parent role.
  • When the Parent role is created viaSettings > 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).

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

  • 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:

managesiteadmins.png

  • Note also that the original (primary) administrator cannot be deleted.

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

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