Reiter
Unterpunkte
Selecting Roles
A major principle of didactic templates is to assign defined permissions to selected roles for changing the way a repository object is used or can be used. This could be by giving a role more permissions or taking existing permissions away. The definition of roles that are affected by the template is done in the roleFilter element. This element can appear within all existing actions elements.
At the time being ILIAS can select a role only by comparing the role title with a defined pattern. Patterns are listed within the roleFilter element and can be used include the filtered selection or to exclude the filtered selection. You can use several pattern elements within one roleFilter element.
Here are three examples:
Here are three examples:
- Example 1The following example shows a filter that blocks all existing roles at the current position by using the includePattern element and the wildcard .* as pattern.
<actions>
...
<roleFilter source="title">
<includePattern preg=".*"/>
</roleFilter>
...
</actions> - Example 2Below you see a filter to select all course member roles by using "^il_crs_member".
<actions>
...
<roleFilter source="title">
<includePattern preg="^il_crs_member"/>
</roleFilter>
...
</actions> - Example 3You can also filter specific roles by using the element excludePattern followed by a regular expression like "^il_crs_member" and "^il_grp_member" for course and group members.
This filter maches all roles whose title does not start with "il_crs_member" or "il_grp_member".<actions>
...
<roleFilter source="title">
<excludePattern preg="^(il_crs_member|il_grp_member)"/>
</roleFilter>
...
</actions>Patterns are combined using an OR-Operator. Therefore, you cannot use more than one separate exclude patterns but have to combine them in one, surrounded by braces and separated by "|".
On the following pages we will use the roleFilter element to define roles in the different actions elements.