Skip to content

Commit

Permalink
add user loginAs and mergeUser permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
ipula committed Dec 6, 2024
1 parent 70ecea1 commit fdfa394
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/managers/UserAccessManager/UserAccessManagerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export const useUserAccessManagerStore = defineComponentStore(
} = useFetchPaginated(apiUrl, {
currentPage,
pageSize: countPerPage,
query: {searchPhrase: searchPhrase, status: 'all'},
query: {
searchPhrase: searchPhrase,
status: 'all',
includePermissions: true,
},
});
watch(
[currentPage, searchPhrase],
Expand Down
22 changes: 12 additions & 10 deletions src/managers/UserAccessManager/useUserAccessManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ export function useUserAccessManagerActions() {
});

if (getCurrentUserId() !== userObj.id) {
actions.push({
label: t('grid.action.logInAs'),
icon: 'LoginAs',
name: Actions.USER_ACCESS_LOGIN_AS,
});
userObj.canLoginAs &&
actions.push({
label: t('grid.action.logInAs'),
icon: 'LoginAs',
name: Actions.USER_ACCESS_LOGIN_AS,
});

actions.push({
label: t('grid.action.remove'),
Expand All @@ -56,11 +57,12 @@ export function useUserAccessManagerActions() {
isWarnable: true,
});

actions.push({
label: t('grid.action.mergeUser'),
icon: 'MergeUser',
name: Actions.USER_ACCESS_MERGE_USER,
});
userObj.canMergeUser &&
actions.push({
label: t('grid.action.mergeUser'),
icon: 'MergeUser',
name: Actions.USER_ACCESS_MERGE_USER,
});
}

return actions;
Expand Down

0 comments on commit fdfa394

Please sign in to comment.