diff --git a/src/managers/ParticipantManager/ParticipantManager.vue b/src/managers/ParticipantManager/ParticipantManager.vue
index 00824191a..9ebb19579 100644
--- a/src/managers/ParticipantManager/ParticipantManager.vue
+++ b/src/managers/ParticipantManager/ParticipantManager.vue
@@ -41,7 +41,7 @@
{
- return `submissions/${encodeURIComponent(submissionId.value)}/participants/${props.submissionStageId}`;
+ return `submissions/${encodeURIComponent(submissionId.value)}/participants/${props.submissionStageId}?includeCanLoginAs=1&includeGossip=1`;
});
const {apiUrl: participantApiUrl} = useUrl(relativeUrl);
@@ -50,7 +50,8 @@ export const useParticipantManagerStore = defineComponentStore(
roleId: stageAssignment.stageAssignmentUserGroup.roleId,
userGroupId: stageAssignment.stageAssignmentUserGroup.id,
recommendOnly: stageAssignment.recommendOnly,
- displayInitials: participant.displayInitials,
+ canLoginAs: participant.canLoginAs,
+ canGossip: participant.canGossip,
});
});
});
@@ -74,7 +75,10 @@ export const useParticipantManagerStore = defineComponentStore(
const _actionFns = useParticipantManagerActions();
- const itemActions = computed(() => _actionFns.getItemActions({}));
+ const itemActions = (participant) => {
+ return _actionFns.getItemActions(participant);
+ };
+
function enrichActionArg(args) {
return {
diff --git a/src/managers/ParticipantManager/useParticipantManagerActions.js b/src/managers/ParticipantManager/useParticipantManagerActions.js
index 2bd8a02d6..a98ad3a84 100644
--- a/src/managers/ParticipantManager/useParticipantManagerActions.js
+++ b/src/managers/ParticipantManager/useParticipantManagerActions.js
@@ -169,14 +169,16 @@ export function useParticipantManagerActions() {
});
}
- function getItemActions() {
+ // take participant as a parameter
+ function getItemActions(participant) {
const {t} = useLocalize();
const actions = [];
+ console.log('Participant ID:', participant.id, 'canLoginAs:', participant.canLoginAs, 'Type:', typeof participant.canLoginAs);
+
// [Role::ROLE_ID_MANAGER, Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_SUB_EDITOR],
const {hasCurrentUserAtLeastOneRole} = useCurrentUser();
-
const canAdminister = hasCurrentUserAtLeastOneRole([
pkp.const.ROLE_ID_MANAGER,
pkp.const.ROLE_ID_SITE_ADMIN,
@@ -197,12 +199,15 @@ export function useParticipantManagerActions() {
icon: 'Email',
});
- // TODO https://github.com/pkp/pkp-lib/issues/10290
- actions.push({
- label: t('grid.action.logInAs'),
- name: Actions.PARTICIPANT_LOGIN_AS,
- icon: 'LoginAs',
- });
+ // show "Login As" if participant.canLoginAs is true
+ if (
+ participant.canLoginAs === true) {
+ actions.push({
+ label: t('grid.action.logInAs'),
+ name: Actions.PARTICIPANT_LOGIN_AS,
+ icon: 'LoginAs',
+ });
+ }
if (canAdminister) {
actions.push({
diff --git a/src/managers/ReviewerManager/useReviewerManagerActions.js b/src/managers/ReviewerManager/useReviewerManagerActions.js
index b5dcddbd1..950f648d1 100644
--- a/src/managers/ReviewerManager/useReviewerManagerActions.js
+++ b/src/managers/ReviewerManager/useReviewerManagerActions.js
@@ -178,11 +178,13 @@ export function useReviewerManagerActions() {
});
// Login as TODO condition
- actions.push({
- label: t('grid.action.logInAs'),
- name: Actions.REVIEWER_LOGIN_AS,
- icon: 'LoginAs',
- });
+ if (reviewAssignment.canLoginAs) {
+ actions.push({
+ label: t('grid.action.logInAs'),
+ name: Actions.REVIEWER_LOGIN_AS,
+ icon: 'LoginAs',
+ });
+ }
// Gossip TODO condition
actions.push({