aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/app.js
blob: 0fdf2b1d93c697ac0d9ddebc5f48d2be19f06985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import React from 'react';
import ReactDOM from 'react-dom';
import Main from './main';
import { getCurrentUser } from '../../api/users';

window.sonarqube.appStarted.then(options => {
  getCurrentUser().done(user => {
    let el = document.querySelector(options.el);
    let hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1;
    let topLevelQualifiers = options.rootQualifiers;
    ReactDOM.render(<Main hasProvisionPermission={hasProvisionPermission}
                       topLevelQualifiers={topLevelQualifiers}/>, el);
  });
});