Skip to content

Commit 1f61c70

Browse files
committed
Fixing bug - superadmin should be able to add student to any group.
1 parent ccfd6ce commit 1f61c70

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

src/pages/GroupDetail/GroupDetail.js

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -347,26 +347,27 @@ class GroupDetail extends Component {
347347

348348
{
349349
// unfortunatelly, this cannot be covered by permission hints at the moment, since addStudent involes both student and group
350-
(isGroupSupervisor || isGroupAdmin) &&
351-
!data.organizational &&
352-
!data.archived &&
353-
isSupervisorRole(effectiveRole) &&
354-
!isStudentRole(effectiveRole) && (
355-
<Row>
356-
<Col sm={6}>
357-
<Box
358-
title={
359-
<FormattedMessage
360-
id="app.group.spervisorsView.addStudent"
361-
defaultMessage="Add Student"
362-
/>
363-
}
364-
isOpen>
365-
<AddStudent instanceId={data.privateData.instanceId} groupId={data.id} />
366-
</Box>
367-
</Col>
368-
</Row>
369-
)
350+
(isSuperadminRole(effectiveRole) ||
351+
((isGroupSupervisor || isGroupAdmin) &&
352+
!data.organizational &&
353+
!data.archived &&
354+
isSupervisorRole(effectiveRole) &&
355+
!isStudentRole(effectiveRole))) && (
356+
<Row>
357+
<Col sm={6}>
358+
<Box
359+
title={
360+
<FormattedMessage
361+
id="app.group.spervisorsView.addStudent"
362+
defaultMessage="Add Student"
363+
/>
364+
}
365+
isOpen>
366+
<AddStudent instanceId={data.privateData.instanceId} groupId={data.id} />
367+
</Box>
368+
</Col>
369+
</Row>
370+
)
370371
}
371372
</>
372373
)}

0 commit comments

Comments
 (0)