Last modified by Carina Enke on 29.07.2026

Show last authors
1 {{section}}
2 {{column width="60%"}}
3 By using expert rules, you can control the visibility and the access to course elements by evaluating the user role or group membership. To do this, use the expert rules **is**[AttrName]() and **in**[AttrName]().
4
5 {{info}}
6 All of the following example rules can be created for both the visibility and access of a course element. For matters of simplicity, the following examples only describe one scenario at a time. To learn more about the difference between visibility and access, see the page [[Publishing within courses (visibility and access)>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Freigabe innerhalb von Kursen Sichtbarkeit und Zugang.WebHome||shape="rect"]].
7 {{/info}}
8 {{/column}}
9
10 {{column width="30%"}}
11 {{panel title="Content"}}
12 {{toc start="2"/}}
13 {{/panel}}
14
15 {{panel title="Related Topics"}}
16 * Further [[application examples for expert rules>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Anwendungsbeispiele zu Expertenregeln.WebHome]]
17 * List of the complete [[Expertensyntax>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Expertensyntax.WebHome]]
18 {{/panel}}
19
20
21
22 {{/column}}
23 {{/section}}
24
25
26
27 == Checking for user role ==
28
29 The following role attributes are available in the learning platform and can be used for expert rules:
30
31 (% class="wrapped" %)
32 |=(% colspan="1" style="width: 171px;" %)(% colspan="1" %)
33 (((
34 Attribute
35 )))|=(% colspan="1" style="width: 1446px;" %)(% colspan="1" %)
36 (((
37 User with
38 )))
39 |=(% colspan="1" style="width: 171px;" %)(% colspan="1" %)
40 (((
41 GlobalAuthor
42 )))|(% colspan="1" style="width:1446px" %)(% colspan="1" %)
43 (((
44 Role Author
45 )))
46 |=(% colspan="1" style="width: 171px;" %)(% colspan="1" %)
47 (((
48 Guest
49 )))|(% colspan="1" style="width:1446px" %)(% colspan="1" %)
50 (((
51 Role Guest
52 )))
53 |=(% style="width: 171px;" %)(((
54 ExternalUser
55 )))|(% style="width:1446px" %)(((
56 Role [[External user >>doc:LMS.Benutzerhandbuch OPAL.Administration.Benutzerverwaltung.Rollen und Rechte.Benutzerrolle Externer Nutzer.WebHome]]
57 )))
58
59 === Examples of Use ===
60
61 (% class="relative-table wrapped" style="width:100.0%" %)
62 |=(% colspan="1" %)(% colspan="1" %)
63 (((
64 Syntax in general
65 )))|=(% colspan="1" %)(% colspan="1" %)
66 (((
67 Entry
68 )))|=(% colspan="1" %)(% colspan="1" %)
69 (((
70 Result of this rule
71 )))
72 |(% rowspan="3" %)(% rowspan="3" %)
73 (((
74 //is[AttrName]()//
75 )))|(% colspan="1" %)(% colspan="1" %)
76 (((
77 (% class="auto-cursor-target" %)
78 isGuest()=false
79
80 //Alternativ: !isGuest()//
81 )))|(% colspan="1" %)(% colspan="1" %)
82 (((
83 If an entry is made in the Access tab, guests will not have access to this course element.
84 )))
85 |(% colspan="1" %)(% colspan="1" %)
86 (((
87 (% class="content-wrapper" %)
88 (((
89 isGuest()
90
91 //Alternativ: isGuest()=true oder isGuest()=1//
92 )))
93 )))|(((
94 If an entry is made in the Visibility tab, only guests will see this course element, while all the registered users will not.
95 )))
96 |(% colspan="1" %)(% colspan="1" %)
97 (((
98 isGuest() or isExternalUser()
99 )))|(% colspan="1" %)(% colspan="1" %)
100 (((
101 If an entry is made in the Visibility tab, only guests and external users will see the course element.
102 )))
103
104 {{info}}
105 Further details on the guest scenario with sample images of the course view for each user role can be found here: (% class="plugin_pagetree_children_span" %)[[Controlling based on the guest role>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Anwendungsbeispiele zu Expertenregeln.Expertenregeln zur Prüfung von Nutzerrolle und Guppenzugehörigkeit.Steuerung auf Basis der Gastrolle.WebHome]]
106 {{/info}}
107
108 == Checking for group membership ==
109
110 (% class="auto-cursor-target" %)
111 The following memberships of a user in connection with a course can be used for expert rules:
112
113 (% class="wrapped" %)
114 |=(% colspan="1" %)(% colspan="1" %)
115 (((
116 Attribute
117 )))|=(% colspan="1" %)(% colspan="1" %)
118 (((
119 User is a member
120 )))
121 |=(% colspan="1" %)(% colspan="1" %)
122 (((
123 LearningGroup
124 )))|(% colspan="1" %)(% colspan="1" %)
125 (((
126 of a learning group
127 )))
128 |=(% colspan="1" %)(% colspan="1" %)
129 (((
130 LearningArea
131 )))|(% colspan="1" %)(% colspan="1" %)
132 (((
133 of a learning area
134 )))
135 |=(% colspan="1" %)(% colspan="1" %)
136 (((
137 LearningGroupWaitingList
138
139 LearningAreaWaitingList
140 )))|(% colspan="1" %)(% colspan="1" %)
141 (((
142 of the waiting list of a learning group or learning area
143 )))
144 |=(% colspan="1" %)(% colspan="1" %)
145 (((
146 CourseAdministrator
147 )))|(% colspan="1" %)(% colspan="1" %)
148 (((
149 of the course owners
150 )))
151 |=(% colspan="1" %)(% colspan="1" %)
152 (((
153 CourseCoach
154 )))|(% colspan="1" %)(% colspan="1" %)
155 (((
156 of the learning group tutor
157 )))
158 |=(% colspan="1" %)(% colspan="1" %)
159 (((
160 RightGroup
161 )))|(% colspan="1" %)(% colspan="1" %)
162 (((
163 of a rights group
164 )))
165
166 === Examples of Use ===
167
168
169 |=(% colspan="1" %)(% colspan="1" %)
170 (((
171 Syntax in general
172 )))|=(% colspan="1" %)(% colspan="1" %)
173 (((
174 Example of an expert rule
175 )))|=(% colspan="1" %)(% colspan="1" %)
176 (((
177 Result of this rule
178 )))
179 |(% rowspan="2" %)(% rowspan="2" %)
180 (((
181 //inLearningGroup("//[string]//")//
182 )))|(% colspan="1" %)(% colspan="1" %)
183 (((
184 (% class="content-wrapper" %)
185 (((
186 inLearningGroup("Beginner")= false
187
188 //Alternativ: !inLearningGroup("Beginner")//
189 )))
190 )))|(((
191 If an entry is made in the Visibility tab, all course participants except for the (learning) group with the "Beginner" title will see the course element.
192 )))
193 |(% colspan="1" %)(% colspan="1" %)
194 (((
195 (% class="content-wrapper" %)
196 (((
197 (% class="auto-cursor-target" %)
198 inLearningGroup("Internal")
199 )))
200 )))|(% colspan="1" %)(% colspan="1" %)
201 (((
202 If an entry is made in the Visibility tab, only members of the "Internal" group will see the course element. Even course owners and group tutors cannot see the course element in the course navigation.
203 )))
204 |(% colspan="1" %)(% colspan="1" %)
205 (((
206 //(now >= date("tt.mm.yyy hh:mm")) and (now <= date("tt.mm.yyy hh:mm")) or inLearningGroup("[string]")//
207 )))|(% colspan="1" %)(% colspan="1" %)
208 (((
209 (% class="content-wrapper" %)
210 (((
211 (now >= date("22.03.2020 12:00")) and (now <= date("23.08.2020 18:00")) or inLearningGroup("Tutor")
212 )))
213 )))|(((
214 If an entry is made in the Visibility tab, the course element will be visible to all course participants within a certain period of time (22.03.2020 - 23.08.2020), while it will be visible to members of the learning group with the title “tutor" at any time.
215 )))
216 |(% colspan="1" %)(% colspan="1" %)
217 (((
218 //(now >= date("tt.mm.yyy hh:mm")) and (now <= date("tt.mm.yyy hh:mm")) or inRightGroup("[string]") or isUser("[string]")//
219 )))|(% colspan="1" %)(% colspan="1" %)
220 (((
221 (% class="content-wrapper" %)
222 (((
223 (% class="auto-cursor-target" %)
224 (now >= date("03.09.2020 00:00")) and (now <= date("13.10.2020 00:00")) and inRightGroup("Assessors")or isUser("Natalie")
225 )))
226 )))|(((
227 If an entry is made in the Visibility tab, the course element will be visible to all course participants in the rights group with the title "Assessors" within a period of time (03.09.2020 - 13.10.2020), while it will be visible to the person with the user name "Natalie" at all times.
228 )))
229 |(% colspan="1" %)//is[AttrName]()//|(% colspan="1" %)isGuest() or isCourseAdministrator() |If an entry is made in the Visibility tab, only guests and course owners will see the course element.
230
231 Create additional rules by using expert syntax. A tabular overview is provided on the page [[Expertensyntax>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Expertensyntax.WebHome]].