Skip to content

Commit 1d36bc4

Browse files
committed
Fixing permission hints in assignment navigation links.
1 parent 643f605 commit 1d36bc4

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

src/pages/Assignment/Assignment.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ import {
3535
isAssignmentSolversLoading,
3636
getAssignmentSolverSelector,
3737
} from '../../redux/selectors/solutions';
38-
import {
39-
loggedUserIsStudentOfSelector,
40-
loggedUserIsObserverOfSelector,
41-
loggedUserIsSupervisorOfSelector,
42-
loggedUserIsAdminOfSelector,
43-
} from '../../redux/selectors/usersGroups';
38+
import { loggedUserIsStudentOfSelector } from '../../redux/selectors/usersGroups';
4439

4540
import Page from '../../components/layout/Page';
4641
import { AssignmentNavigation } from '../../components/layout/Navigation';
@@ -97,9 +92,6 @@ class Assignment extends Component {
9792
loggedInUserId,
9893
init,
9994
isStudentOf,
100-
isObserverOf,
101-
isSupervisorOf,
102-
isAdminOf,
10395
canSubmit,
10496
runtimeEnvironments,
10597
exerciseSync,
@@ -124,7 +116,10 @@ class Assignment extends Component {
124116
canEdit={hasPermissions(assignment, 'update')}
125117
canViewSolutions={hasPermissions(assignment, 'viewAssignmentSolutions')}
126118
canViewExercise={
127-
isObserverOf(assignment.groupId) || isSupervisorOf(assignment.groupId) || isAdminOf(assignment.groupId)
119+
hasPermissions(
120+
assignment,
121+
'viewAssignmentSolutions'
122+
) /* this is not the exact hint, but we do not have anything better now */
128123
}
129124
/>
130125

@@ -266,9 +261,6 @@ Assignment.propTypes = {
266261
}).isRequired,
267262
}).isRequired,
268263
isStudentOf: PropTypes.func.isRequired,
269-
isObserverOf: PropTypes.func.isRequired,
270-
isSupervisorOf: PropTypes.func.isRequired,
271-
isAdminOf: PropTypes.func.isRequired,
272264
assignment: PropTypes.object,
273265
canSubmit: ImmutablePropTypes.map,
274266
submitting: PropTypes.bool.isRequired,
@@ -301,9 +293,6 @@ export default connect(
301293
userId,
302294
loggedInUserId,
303295
isStudentOf: loggedUserIsStudentOfSelector(state),
304-
isObserverOf: loggedUserIsObserverOfSelector(state),
305-
isSupervisorOf: loggedUserIsSupervisorOfSelector(state),
306-
isAdminOf: loggedUserIsAdminOfSelector(state),
307296
canSubmit: canSubmitSolution(assignmentId)(state),
308297
solutions: getUserSolutionsSortedData(state)(userId || loggedInUserId, assignmentId),
309298
fetchManyStatus: fetchManyUserSolutionsStatus(state)(userId || loggedInUserId, assignmentId),

0 commit comments

Comments
 (0)