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

Creating custom roles

From MoodleDocs
Revision as of 12:57, 1 August 2011 by Colin Fraser (talk | contribs)

Template:Roles and capabilities

Custom Roles are roles that are not part of the core code, not downloaded with the installation files. There are always reasons to establish a custom role, and each custom role needs to be created. The basic process is the same for all custom roles so in this page we will create a role then use it as a Parent role.

Go to: Site Administration > Users > Permissions > Define Roles

Scroll to the bottom of the page and click on Add New Role button.

This brings up the Adding a new role screen.

In the Role name dialog, enter the name of the role that you want to create, "Parent" and retype the name in the "Short name" dialog.

In the Summary dialog enter something like as shown here:

Naming a Custom Role

Moodle 2 uses Roles in a context, so we have to place the Role into a context so we can use it. Scroll down to "Context where this role may be assigned" and click on the User check box.

Providing a context for the Custom Role

We then need to scroll back up to the top of the page and click the "Create this role" button.

Saving the new Custom Role

This creates a Custom Role and it is the Context in which the role is to be used that determines what permissions the role actually begins with. If you wish to use the role in a particular way, then you may want change permissions to suit your purpose, as in this Parent role.

As you get more familiar with the ideas of custom roles, and you have a better idea of the permissions and capabilities you want the role to actually have when you create it, you will find that you can edit the capabilities of that role on this same page you used to create the Role.

Once the Custom Role has been created, it then needs to be managed appropriately. In the graphic below, there are three more tabs that can be visited to assign permissions to access and assign the Custom Role in all circumstances.

Assigning rights to access and assign the new Custom Role

In this case, the Admin User, the Manager and a Teacher can all assign rights to this role.

lightbulb.png
It is suggested, although not always recommended, that Teachers be given the rights to switch their Roles to Non-Editing Teacher, to Student, to Guest, if Guests are allowed on the site as well as to any Custom Role that access a Course. The reasons for this are obvious - but if stated then it would have to be that the Teacher can check to ensure the Role works as it should work, as they want it to work in the context of their courses. This way they do not have to rely upon an Admin to check for them.

See Also