@@ -12,7 +12,7 @@ import {chipTypeForUserRole} from "../utils/Authority";
1212import { allowedToRenewUserRole , AUTHORITIES , highestAuthority , isUserAllowed } from "../utils/UserRole" ;
1313import ConfirmationDialog from "../components/ConfirmationDialog" ;
1414import { deleteUserRole , searchUserRolesByRoleId , updateUserRoleEndData } from "../api" ;
15- import { isEmpty , pseudoGuid } from "../utils/Utils" ;
15+ import { isEmpty , pseudoGuid , stopEvent } from "../utils/Utils" ;
1616import { MinimalDateField } from "../components/MinimalDateField" ;
1717import { defaultPagination , pageCount } from "../utils/Pagination" ;
1818import debounce from "lodash.debounce" ;
@@ -355,6 +355,19 @@ export const UserRoles = ({role, guests}) => {
355355 } ,
356356 ] ;
357357
358+ const isAllowedToSeeUserDetails =
359+ isUserAllowed ( AUTHORITIES . SUPER_USER , user ) || isUserAllowed ( AUTHORITIES . INSTITUTION_ADMIN , user ) ;
360+
361+ const navigateToUserDetails = ( e , invitation ) => {
362+ const path = `/profile/${ invitation . user_id } `
363+ if ( e . metaKey || e . ctrlKey ) {
364+ window . open ( path , '_blank' ) ;
365+ } else {
366+ stopEvent ( e ) ;
367+ navigate ( path ) ;
368+ }
369+ }
370+
358371 return ( < div className = "mod-user-roles" >
359372 { confirmationOpen && < ConfirmationDialog isOpen = { confirmationOpen }
360373 cancel = { confirmation . cancel }
@@ -381,6 +394,7 @@ export const UserRoles = ({role, guests}) => {
381394 inputFocus = { ! searching }
382395 hideTitle = { searching }
383396 busy = { searching }
397+ rowLinkMapper = { isAllowedToSeeUserDetails && navigateToUserDetails }
384398 />
385399
386400 </ div > )
0 commit comments