File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/client/components/Courses/Course Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,12 @@ const Course = () => {
122
122
boxSizing : 'borderBox' ,
123
123
height : '40px' ,
124
124
}
125
+
126
+ const isAdminOrResponsible = ( ) => {
127
+ return user . isAdmin || chatInstance . responsibilities . find ( ( r ) => r . user . username === user . username )
128
+ }
129
+ const userIsAdminOrResponsible = isAdminOrResponsible ( )
130
+
125
131
const handleAddResponsible = async ( user : User ) => {
126
132
127
133
const username = user . username
@@ -236,7 +242,7 @@ const Course = () => {
236
242
) }
237
243
</ div >
238
244
239
- { user . isAdmin && (
245
+ { userIsAdminOrResponsible && (
240
246
< >
241
247
< Button onClick = { ( ) => setShowTeachers ( ! showTeachers ) } style = { { marginTop : 10 , marginLeft : - 8 } } >
242
248
{ showTeachers ? t ( 'admin:hideTeachers' ) : t ( 'admin:showTeachers' ) }
You can’t perform that action at this time.
0 commit comments