Merge branch 'origin/master' into 14478-log-in-into-clusters
authorDaniel Kos <daniel.kos@contractors.roche.com>
Tue, 18 Dec 2018 09:39:54 +0000 (10:39 +0100)
committerDaniel Kos <daniel.kos@contractors.roche.com>
Tue, 18 Dec 2018 09:39:54 +0000 (10:39 +0100)
Feature #14478

# Conflicts:
# src/common/config.ts
# src/components/text-field/text-field.tsx
# src/routes/route-change-handlers.ts
# src/routes/routes.ts
# src/services/auth-service/auth-service.ts
# src/services/common-service/common-resource-service.ts
# src/services/services.ts
# src/store/auth/auth-action.ts
# src/store/navigation/navigation-action.ts
# src/store/workbench/workbench-actions.ts
# src/validators/validators.tsx
# src/views-components/main-app-bar/account-menu.tsx
# src/views-components/main-content-bar/main-content-bar.tsx
# src/views/workbench/workbench.tsx

Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos@contractors.roche.com>

14 files changed:
1  2 
src/common/config.ts
src/components/text-field/text-field.tsx
src/index.tsx
src/routes/route-change-handlers.ts
src/routes/routes.ts
src/services/auth-service/auth-service.ts
src/store/auth/auth-action-session.ts
src/store/auth/auth-action.test.ts
src/store/navigation/navigation-action.ts
src/store/workbench/workbench-actions.ts
src/validators/validators.tsx
src/views-components/main-app-bar/account-menu.tsx
src/views-components/main-content-bar/main-content-bar.tsx
src/views/workbench/workbench.tsx

index d801c5fa67b1189278daecb3df0138a7cd4dc5a8,db67ed8dceec9fc06837945cba4a820682a642af..3961d5aa2496fec7fbba912a96738f1bc15b8b5d
@@@ -126,7 -130,7 +132,8 @@@ interface ConfigJSON 
  const getDefaultConfig = (): ConfigJSON => ({
      API_HOST: process.env.REACT_APP_ARVADOS_API_HOST || "",
      VOCABULARY_URL: "",
+     FILE_VIEWERS_CONFIG_URL: "",
  });
  
 -const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/discovery/v1/apis/arvados/v1/rest`;
 +export const DISCOVERY_URL = 'discovery/v1/apis/arvados/v1/rest';
 +const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${DISCOVERY_URL}`;
index 0ebb46bcaae5ff389f1b705c7214f3ef68aaa5fe,627e004d8b5bc607f6b92c673df92cbdb226fd57..93c4080f0fead0c7330f0a65a6824bdb628da8e1
@@@ -25,8 -18,8 +25,8 @@@ const styles: StyleRulesCallback<CssRul
  
  type TextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
  
 -export const TextField = withStyles(styles)((props: TextFieldProps & { 
 -    label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, disabled?: boolean, children: React.ReactNode
 +export const TextField = withStyles(styles)((props: TextFieldProps & {
-     label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, children: React.ReactNode, margin?: Margin, placeholder?: string
++    label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, disabled?: boolean, children: React.ReactNode, margin?: Margin, placeholder?: string
  }) =>
      <MaterialTextField
          helperText={props.meta.touched && props.meta.error}
diff --cc src/index.tsx
Simple merge
index 0637a3848b5539008ca69bc6540c1e1c157b739d,03e2a38aee5deb3de1a0e0663bae503d2bfe64aa..bb88f4a1aff5c33173d9526a9d74753f25a53abf
@@@ -26,12 -29,23 +29,24 @@@ const handleLocationChange = (store: Ro
      const searchResultsMatch = Routes.matchSearchResultsRoute(pathname);
      const sharedWithMeMatch = Routes.matchSharedWithMeRoute(pathname);
      const runProcessMatch = Routes.matchRunProcessRoute(pathname);
-     const virtualMachineMatch = Routes.matchVirtualMachineRoute(pathname);
+     const virtualMachineUserMatch = Routes.matchUserVirtualMachineRoute(pathname);
+     const virtualMachineAdminMatch = Routes.matchAdminVirtualMachineRoute(pathname);
      const workflowMatch = Routes.matchWorkflowRoute(pathname);
-     const sshKeysMatch = Routes.matchSshKeysRoute(pathname);
+     const sshKeysUserMatch = Routes.matchSshKeysUserRoute(pathname);
+     const sshKeysAdminMatch = Routes.matchSshKeysAdminRoute(pathname);
 +    const siteManagerMatch = Routes.matchSiteManagerRoute(pathname);
      const keepServicesMatch = Routes.matchKeepServicesRoute(pathname);
      const computeNodesMatch = Routes.matchComputeNodesRoute(pathname);
+     const apiClientAuthorizationsMatch = Routes.matchApiClientAuthorizationsRoute(pathname);
+     const myAccountMatch = Routes.matchMyAccountRoute(pathname);
+     const userMatch = Routes.matchUsersRoute(pathname);
+     const groupsMatch = Routes.matchGroupsRoute(pathname);
+     const groupDetailsMatch = Routes.matchGroupDetailsRoute(pathname);
+     const linksMatch = Routes.matchLinksRoute(pathname);
+     store.dispatch(dialogActions.CLOSE_ALL_DIALOGS());
+     store.dispatch(contextMenuActions.CLOSE_CONTEXT_MENU());
+     store.dispatch(searchBarActions.CLOSE_SEARCH_VIEW());
  
      if (projectMatch) {
          store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id));
          store.dispatch(WorkbenchActions.loadWorkflow);
      } else if (searchResultsMatch) {
          store.dispatch(WorkbenchActions.loadSearchResults);
-     } else if (virtualMachineMatch) {
+     } else if (virtualMachineUserMatch) {
+         store.dispatch(WorkbenchActions.loadVirtualMachines);
+     } else if (virtualMachineAdminMatch) {
          store.dispatch(WorkbenchActions.loadVirtualMachines);
-     } else if(repositoryMatch) {
+     } else if (repositoryMatch) {
          store.dispatch(WorkbenchActions.loadRepositories);
-     } else if (sshKeysMatch) {
+     } else if (sshKeysUserMatch) {
+         store.dispatch(WorkbenchActions.loadSshKeys);
+     } else if (sshKeysAdminMatch) {
          store.dispatch(WorkbenchActions.loadSshKeys);
 +    } else if (siteManagerMatch) {
 +        store.dispatch(WorkbenchActions.loadSiteManager);
      } else if (keepServicesMatch) {
          store.dispatch(WorkbenchActions.loadKeepServices);
      } else if (computeNodesMatch) {
index b5cb0aca460a4e8aa64e717c63cf5f66fb0a5501,661a065eb35848bbfaef168d58af2781960f92ad..b1da949652e60d0046e5487de5aa8f6279243bb2
@@@ -19,13 -19,20 +19,21 @@@ export const Routes = 
      REPOSITORIES: '/repositories',
      SHARED_WITH_ME: '/shared-with-me',
      RUN_PROCESS: '/run-process',
-     VIRTUAL_MACHINES: '/virtual-machines',
+     VIRTUAL_MACHINES_ADMIN: '/virtual-machines-admin',
+     VIRTUAL_MACHINES_USER: '/virtual-machines-user',
      WORKFLOWS: '/workflows',
      SEARCH_RESULTS: '/search-results',
-     SSH_KEYS: `/ssh-keys`,
+     SSH_KEYS_ADMIN: `/ssh-keys-admin`,
+     SSH_KEYS_USER: `/ssh-keys-user`,
 +    SITE_MANAGER: `/site-manager`,
+     MY_ACCOUNT: '/my-account',
      KEEP_SERVICES: `/keep-services`,
-     COMPUTE_NODES: `/nodes`
+     COMPUTE_NODES: `/nodes`,
+     USERS: '/users',
+     API_CLIENT_AUTHORIZATIONS: `/api_client_authorizations`,
+     GROUPS: '/groups',
+     GROUP_DETAILS: `/group/:id(${RESOURCE_UUID_PATTERN})`,
+     LINKS: '/links'
  };
  
  export const getResourceUrl = (uuid: string) => {
@@@ -89,12 -101,15 +102,18 @@@ export const matchAdminVirtualMachineRo
  export const matchRepositoriesRoute = (route: string) =>
      matchPath<ResourceRouteParams>(route, { path: Routes.REPOSITORIES });
  
- export const matchSshKeysRoute = (route: string) =>
-     matchPath(route, { path: Routes.SSH_KEYS });
+ export const matchSshKeysUserRoute = (route: string) =>
+     matchPath(route, { path: Routes.SSH_KEYS_USER });
+ export const matchSshKeysAdminRoute = (route: string) =>
+     matchPath(route, { path: Routes.SSH_KEYS_ADMIN });
  
 +export const matchSiteManagerRoute = (route: string) =>
 +    matchPath(route, { path: Routes.SITE_MANAGER });
 +
+ export const matchMyAccountRoute = (route: string) =>
+     matchPath(route, { path: Routes.MY_ACCOUNT });
  export const matchKeepServicesRoute = (route: string) =>
      matchPath(route, { path: Routes.KEEP_SERVICES });
  
index 1492ef1c9f6d2d55599d75d113f5b4d55415d789,22c9dcd6ae3e36e495f25a9e152f9a489506efdc..8601e2084def92f70cc82794ae19ad3b24353c5c
@@@ -2,7 -2,7 +2,7 @@@
  //
  // SPDX-License-Identifier: AGPL-3.0
  
- import { getUserFullname, User } from "~/models/user";
 -import { User, UserPrefs } from "~/models/user";
++import { getUserFullname, User, UserPrefs } from "~/models/user";
  import { AxiosInstance } from "axios";
  import { ApiActions } from "~/services/api/api-actions";
  import * as uuid from "uuid/v4";
index 4a6f56f92d9b4270f5a0e6065d3cf86aa4afe7e9,0000000000000000000000000000000000000000..83e98e968afbc0b47061a60313cf33b96a06da30
mode 100644,000000..100644
--- /dev/null
@@@ -1,206 -1,0 +1,208 @@@
-             isAdmin: user.is_admin
 +// Copyright (C) The Arvados Authors. All rights reserved.
 +//
 +// SPDX-License-Identifier: AGPL-3.0
 +
 +import { Dispatch } from "redux";
 +import { setBreadcrumbs } from "~/store/breadcrumbs/breadcrumbs-actions";
 +import { RootState } from "~/store/store";
 +import { ServiceRepository } from "~/services/services";
 +import Axios from "axios";
 +import { getUserFullname, User } from "~/models/user";
 +import { authActions } from "~/store/auth/auth-action";
 +import { Config, DISCOVERY_URL } from "~/common/config";
 +import { Session, SessionStatus } from "~/models/session";
 +import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
 +import { UserDetailsResponse } from "~/services/auth-service/auth-service";
 +import * as jsSHA from "jssha";
 +
 +const getRemoteHostBaseUrl = async (remoteHost: string): Promise<string | null> => {
 +    let url = remoteHost;
 +    if (url.indexOf('://') < 0) {
 +        url = 'https://' + url;
 +    }
 +    const origin = new URL(url).origin;
 +    let baseUrl: string | null = null;
 +
 +    try {
 +        const resp = await Axios.get<Config>(`${origin}/${DISCOVERY_URL}`);
 +        baseUrl = resp.data.baseUrl;
 +    } catch (err) {
 +        try {
 +            const resp = await Axios.get<any>(`${origin}/status.json`);
 +            baseUrl = resp.data.apiBaseURL;
 +        } catch (err) {
 +        }
 +    }
 +
 +    if (baseUrl && baseUrl[baseUrl.length - 1] === '/') {
 +        baseUrl = baseUrl.substr(0, baseUrl.length - 1);
 +    }
 +
 +    return baseUrl;
 +};
 +
 +const getUserDetails = async (baseUrl: string, token: string): Promise<UserDetailsResponse> => {
 +    const resp = await Axios.get<UserDetailsResponse>(`${baseUrl}/users/current`, {
 +        headers: {
 +            Authorization: `OAuth2 ${token}`
 +        }
 +    });
 +    return resp.data;
 +};
 +
 +const getTokenUuid = async (baseUrl: string, token: string): Promise<string> => {
 +    if (token.startsWith("v2/")) {
 +        const uuid = token.split("/")[1];
 +        return Promise.resolve(uuid);
 +    }
 +
 +    const resp = await Axios.get(`${baseUrl}/api_client_authorizations`, {
 +        headers: {
 +            Authorization: `OAuth2 ${token}`
 +        },
 +        data: {
 +            filters: JSON.stringify([['api_token', '=', token]])
 +        }
 +    });
 +
 +    return resp.data.items[0].uuid;
 +};
 +
 +const getSaltedToken = (clusterId: string, tokenUuid: string, token: string) => {
 +    const shaObj = new jsSHA("SHA-1", "TEXT");
 +    let secret = token;
 +    if (token.startsWith("v2/")) {
 +        secret = token.split("/")[2];
 +    }
 +    shaObj.setHMACKey(secret, "TEXT");
 +    shaObj.update(clusterId);
 +    const hmac = shaObj.getHMAC("HEX");
 +    return `v2/${tokenUuid}/${hmac}`;
 +};
 +
 +const clusterLogin = async (clusterId: string, baseUrl: string, activeSession: Session): Promise<{user: User, token: string}> => {
 +    const tokenUuid = await getTokenUuid(activeSession.baseUrl, activeSession.token);
 +    const saltedToken = getSaltedToken(clusterId, tokenUuid, activeSession.token);
 +    const user = await getUserDetails(baseUrl, saltedToken);
 +    return {
 +        user: {
 +            firstName: user.first_name,
 +            lastName: user.last_name,
 +            uuid: user.uuid,
 +            ownerUuid: user.owner_uuid,
 +            email: user.email,
++            isAdmin: user.is_admin,
++            identityUrl: user.identity_url,
++            prefs: user.prefs
 +        },
 +        token: saltedToken
 +    };
 +};
 +
 +const getActiveSession = (sessions: Session[]): Session | undefined => sessions.find(s => s.active);
 +
 +export const validateCluster = async (remoteHost: string, clusterId: string, activeSession: Session): Promise<{ user: User; token: string, baseUrl: string }> => {
 +    const baseUrl = await getRemoteHostBaseUrl(remoteHost);
 +    if (!baseUrl) {
 +        return Promise.reject(`Could not find base url for ${remoteHost}`);
 +    }
 +    const { user, token } = await clusterLogin(clusterId, baseUrl, activeSession);
 +    return { baseUrl, user, token };
 +};
 +
 +export const validateSession = (session: Session, activeSession: Session) =>
 +    async (dispatch: Dispatch): Promise<Session> => {
 +        dispatch(authActions.UPDATE_SESSION({ ...session, status: SessionStatus.BEING_VALIDATED }));
 +        session.loggedIn = false;
 +        try {
 +            const { baseUrl, user, token } = await validateCluster(session.remoteHost, session.clusterId, activeSession);
 +            session.baseUrl = baseUrl;
 +            session.token = token;
 +            session.email = user.email;
 +            session.username = getUserFullname(user);
 +            session.loggedIn = true;
 +        } catch {
 +            session.loggedIn = false;
 +        } finally {
 +            session.status = SessionStatus.VALIDATED;
 +            dispatch(authActions.UPDATE_SESSION(session));
 +        }
 +        return session;
 +    };
 +
 +export const validateSessions = () =>
 +    async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
 +        const sessions = getState().auth.sessions;
 +        const activeSession = getActiveSession(sessions);
 +        if (activeSession) {
 +            dispatch(progressIndicatorActions.START_WORKING("sessionsValidation"));
 +            for (const session of sessions) {
 +                if (session.status === SessionStatus.INVALIDATED) {
 +                    await dispatch(validateSession(session, activeSession));
 +                }
 +            }
 +            services.authService.saveSessions(sessions);
 +            dispatch(progressIndicatorActions.STOP_WORKING("sessionsValidation"));
 +        }
 +    };
 +
 +export const addSession = (remoteHost: string) =>
 +    async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
 +        const sessions = getState().auth.sessions;
 +        const activeSession = getActiveSession(sessions);
 +        if (activeSession) {
 +            const clusterId = remoteHost.match(/^(\w+)\./)![1];
 +            if (sessions.find(s => s.clusterId === clusterId)) {
 +                return Promise.reject("Cluster already exists");
 +            }
 +            try {
 +                const { baseUrl, user, token } = await validateCluster(remoteHost, clusterId, activeSession);
 +                const session = {
 +                    loggedIn: true,
 +                    status: SessionStatus.VALIDATED,
 +                    active: false,
 +                    email: user.email,
 +                    username: getUserFullname(user),
 +                    remoteHost,
 +                    baseUrl,
 +                    clusterId,
 +                    token
 +                };
 +
 +                dispatch(authActions.ADD_SESSION(session));
 +                services.authService.saveSessions(getState().auth.sessions);
 +
 +                return session;
 +            } catch (e) {
 +            }
 +        }
 +        return Promise.reject("Could not validate cluster");
 +    };
 +
 +export const toggleSession = (session: Session) =>
 +    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 +        let s = { ...session };
 +
 +        if (session.loggedIn) {
 +            s.loggedIn = false;
 +        } else {
 +            const sessions = getState().auth.sessions;
 +            const activeSession = getActiveSession(sessions);
 +            if (activeSession) {
 +                s = await dispatch<any>(validateSession(s, activeSession)) as Session;
 +            }
 +        }
 +
 +        dispatch(authActions.UPDATE_SESSION(s));
 +        services.authService.saveSessions(getState().auth.sessions);
 +    };
 +
 +export const loadSiteManagerPanel = () =>
 +    async (dispatch: Dispatch<any>) => {
 +        try {
 +            dispatch(setBreadcrumbs([{ label: 'Site Manager'}]));
 +            dispatch(validateSessions());
 +        } catch (e) {
 +            return;
 +        }
 +    };
Simple merge
index 8e3929d9501a7ab84b7b16da9012bfb260841c15,c53c55e89287212f91715481a8998fe429fddaf2..f610eb5e99fd6786f8fe975888256c3e544d27d1
@@@ -66,10 -73,12 +73,14 @@@ export const navigateToAdminVirtualMach
  
  export const navigateToRepositories = push(Routes.REPOSITORIES);
  
- export const navigateToSshKeys= push(Routes.SSH_KEYS);
+ export const navigateToSshKeysAdmin= push(Routes.SSH_KEYS_ADMIN);
+ export const navigateToSshKeysUser= push(Routes.SSH_KEYS_USER);
  
 +export const navigateToSiteManager= push(Routes.SITE_MANAGER);
 +
+ export const navigateToMyAccount = push(Routes.MY_ACCOUNT);
  export const navigateToKeepServices = push(Routes.KEEP_SERVICES);
  
  export const navigateToComputeNodes = push(Routes.COMPUTE_NODES);
index fdef38c485384478403d841419be4b0b81d2dc4e,5e9dc285ef2050f98794b4b5cfc632070ce32d4b..46ab1f59e9825bf712fc9425c27b78b7369d80a3
@@@ -39,8 -39,8 +39,9 @@@ import { sharedWithMePanelActions } fro
  import { loadSharedWithMePanel } from '~/store/shared-with-me-panel/shared-with-me-panel-actions';
  import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog';
  import { loadWorkflowPanel, workflowPanelActions } from '~/store/workflow-panel/workflow-panel-actions';
 -import { loadSshKeysPanel } from '~/store/auth/auth-action';
 +import { loadSshKeysPanel } from '~/store/auth/auth-action-ssh';
+ import { loadMyAccountPanel } from '~/store/my-account/my-account-panel-actions';
 +import { loadSiteManagerPanel } from '~/store/auth/auth-action-session';
  import { workflowPanelColumns } from '~/views/workflow-panel/workflow-panel-view';
  import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions';
  import { getProgressIndicator } from '~/store/progress-indicator/progress-indicator-reducer';
@@@ -413,9 -435,9 +436,14 @@@ export const loadSshKeys = handleFirstT
          await dispatch(loadSshKeysPanel());
      });
  
-     async (dispatch: Dispatch<any>) => {
-         await dispatch(loadSiteManagerPanel());
 +export const loadSiteManager = handleFirstTimeLoad(
++async (dispatch: Dispatch<any>) => {
++    await dispatch(loadSiteManagerPanel());
++});
++
+ export const loadMyAccount = handleFirstTimeLoad(
+     (dispatch: Dispatch<any>) => {
+         dispatch(loadMyAccountPanel());
      });
  
  export const loadKeepServices = handleFirstTimeLoad(
index 06f46219414317b94ebeb7d25a25810e750d8920,9bc76419ff03fd713311a25c60b7dc0a4d0822ba..acef9744311ccd82a5d43dcc482eb0250c47cb60
@@@ -28,4 -31,4 +32,6 @@@ export const USER_LENGTH_VALIDATION = [
  export const SSH_KEY_PUBLIC_VALIDATION = [require, isRsaKey, maxLength(1024)];
  export const SSH_KEY_NAME_VALIDATION = [require, maxLength(255)];
  
 +export const SITE_MANAGER_REMOTE_HOST_VALIDATION = [require, isRemoteHost, maxLength(255)];
++
+ export const MY_ACCOUNT_VALIDATION = [require];
index b71c92cb27e730b34eb19b364433d3b372c1683c,53a5753d0c2130380ce900efa2c1f6f73b33698d..6c1e46c52a37ae819491cf043e6b8c4986ca98fe
@@@ -11,14 -11,9 +11,13 @@@ import { DispatchProp, connect } from '
  import { logout } from '~/store/auth/auth-action';
  import { RootState } from "~/store/store";
  import { openCurrentTokenDialog } from '~/store/current-token-dialog/current-token-dialog-actions';
 -import { navigateToSshKeysUser, navigateToMyAccount } from '~/store/navigation/navigation-action';
 +import { openRepositoriesPanel } from "~/store/repositories/repositories-actions";
 +import {
-     navigateToSshKeys,
-     navigateToKeepServices,
-     navigateToComputeNodes,
-     navigateToSiteManager
++    navigateToSiteManager,
++    navigateToSshKeysUser,
++    navigateToMyAccount
 +} from '~/store/navigation/navigation-action';
- import { openVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
+ import { openUserVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
 -import { openRepositoriesPanel } from '~/store/repositories/repositories-actions';
  
  interface AccountMenuProps {
      user?: User;
@@@ -38,14 -36,11 +40,12 @@@ export const AccountMenu = connect(mapS
                  <MenuItem>
                      {getUserFullname(user)}
                  </MenuItem>
-                 <MenuItem onClick={() => dispatch(openVirtualMachines())}>Virtual Machines</MenuItem>
-                 <MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
+                 <MenuItem onClick={() => dispatch(openUserVirtualMachines())}>Virtual Machines</MenuItem>
+                 {!user.isAdmin && <MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>}
                  <MenuItem onClick={() => dispatch(openCurrentTokenDialog)}>Current token</MenuItem>
-                 <MenuItem onClick={() => dispatch(navigateToSshKeys)}>Ssh Keys</MenuItem>
+                 <MenuItem onClick={() => dispatch(navigateToSshKeysUser)}>Ssh Keys</MenuItem>
 +                <MenuItem onClick={() => dispatch(navigateToSiteManager)}>Site Manager</MenuItem>
-                 { user.isAdmin && <MenuItem onClick={() => dispatch(navigateToKeepServices)}>Keep Services</MenuItem> }
-                 { user.isAdmin && <MenuItem onClick={() => dispatch(navigateToComputeNodes)}>Compute Nodes</MenuItem> }
-                 <MenuItem>My account</MenuItem>
+                 <MenuItem onClick={() => dispatch(navigateToMyAccount)}>My account</MenuItem>
                  <MenuItem onClick={() => dispatch(logout())}>Logout</MenuItem>
              </DropdownMenu>
              : null);
index 8b8f9891264fba26f2039e20c1e3addce80cf009,3806b5245a75b0e58acfe4d6c4aba4247acdb434..c0014d005134bc52a706dc4c770baf00ae4907dc
@@@ -18,10 -18,12 +18,13 @@@ interface MainContentBarProps 
  
  const isButtonVisible = ({ router }: RootState) => {
      const pathname = router.location ? router.location.pathname : '';
-     return !Routes.matchWorkflowRoute(pathname) && !Routes.matchVirtualMachineRoute(pathname) &&
-         !Routes.matchRepositoriesRoute(pathname) && !Routes.matchSshKeysRoute(pathname) &&
+     return !Routes.matchWorkflowRoute(pathname) && !Routes.matchUserVirtualMachineRoute(pathname) &&
+         !Routes.matchAdminVirtualMachineRoute(pathname) && !Routes.matchRepositoriesRoute(pathname) &&
+         !Routes.matchSshKeysAdminRoute(pathname) && !Routes.matchSshKeysUserRoute(pathname) &&
++        !Routes.matchSiteManagerRoute(pathname) &&
          !Routes.matchKeepServicesRoute(pathname) && !Routes.matchComputeNodesRoute(pathname) &&
-         !Routes.matchSiteManagerRoute(pathname);
+         !Routes.matchApiClientAuthorizationsRoute(pathname) && !Routes.matchUsersRoute(pathname) &&
+         !Routes.matchMyAccountRoute(pathname) && !Routes.matchLinksRoute(pathname);
  };
  
  export const MainContentBar = connect((state: RootState) => ({
index af2325bffde022e105d6f0db3b1f7d94242775fd,bff328e8c8c6ff448bc271d36068925a8b0cc81d..90b2dad0197215578d8020b1da153d7d38c9e88e
@@@ -45,7 -45,7 +45,8 @@@ import SplitterLayout from 'react-split
  import { WorkflowPanel } from '~/views/workflow-panel/workflow-panel';
  import { SearchResultsPanel } from '~/views/search-results-panel/search-results-panel';
  import { SshKeyPanel } from '~/views/ssh-key-panel/ssh-key-panel';
 +import { SiteManagerPanel } from "~/views/site-manager-panel/site-manager-panel";
+ import { MyAccountPanel } from '~/views/my-account-panel/my-account-panel';
  import { SharingDialog } from '~/views-components/sharing-dialog/sharing-dialog';
  import { AdvancedTabDialog } from '~/views-components/advanced-tab-dialog/advanced-tab-dialog';
  import { ProcessInputDialog } from '~/views-components/process-input-dialog/process-input-dialog';
@@@ -137,12 -156,19 +157,20 @@@ export const WorkbenchPanel 
                                  <Route path={Routes.RUN_PROCESS} component={RunProcessPanel} />
                                  <Route path={Routes.WORKFLOWS} component={WorkflowPanel} />
                                  <Route path={Routes.SEARCH_RESULTS} component={SearchResultsPanel} />
-                                 <Route path={Routes.VIRTUAL_MACHINES} component={VirtualMachinePanel} />
+                                 <Route path={Routes.VIRTUAL_MACHINES_USER} component={VirtualMachineUserPanel} />
+                                 <Route path={Routes.VIRTUAL_MACHINES_ADMIN} component={VirtualMachineAdminPanel} />
                                  <Route path={Routes.REPOSITORIES} component={RepositoriesPanel} />
-                                 <Route path={Routes.SSH_KEYS} component={SshKeyPanel} />
+                                 <Route path={Routes.SSH_KEYS_USER} component={SshKeyPanel} />
+                                 <Route path={Routes.SSH_KEYS_ADMIN} component={SshKeyPanel} />
 +                                <Route path={Routes.SITE_MANAGER} component={SiteManagerPanel} />
                                  <Route path={Routes.KEEP_SERVICES} component={KeepServicePanel} />
+                                 <Route path={Routes.USERS} component={UserPanel} />
                                  <Route path={Routes.COMPUTE_NODES} component={ComputeNodePanel} />
+                                 <Route path={Routes.API_CLIENT_AUTHORIZATIONS} component={ApiClientAuthorizationPanel} />
+                                 <Route path={Routes.MY_ACCOUNT} component={MyAccountPanel} />
+                                 <Route path={Routes.GROUPS} component={GroupsPanel} />
+                                 <Route path={Routes.GROUP_DETAILS} component={GroupDetailsPanel} />
+                                 <Route path={Routes.LINKS} component={LinkPanel} />
                              </Switch>
                          </Grid>
                      </Grid>
              <UpdateCollectionDialog />
              <UpdateProcessDialog />
              <UpdateProjectDialog />
+             <UserAttributesDialog />
              <VirtualMachineAttributesDialog />
          </Grid>
 -    );
 +    );