diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-02-20 13:34:40 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2017-02-20 13:34:40 +0100 |
commit | 5f09ded3a60950b1db7714f70f66850216acbff9 (patch) | |
tree | f7077c6a39e7eacbb309a671ab41887d03e23950 /server/sonar-web/src/main | |
parent | f6f2bbf78e59251b2bccb4dd757bb203c746e518 (diff) | |
download | sonarqube-5f09ded3a60950b1db7714f70f66850216acbff9.tar.gz sonarqube-5f09ded3a60950b1db7714f70f66850216acbff9.zip |
SONAR-8658 display "Apply Template" button for org admin
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r-- | server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.js b/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.js index 998951466d5..bc97d1c6ddf 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.js +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.js @@ -23,7 +23,6 @@ import { translate } from '../../../../helpers/l10n'; import ApplyTemplateView from '../views/ApplyTemplateView'; import { loadHolders } from '../store/actions'; import { isPermissionsAppLoading } from '../../../../store/rootReducer'; -import { isUserAdmin } from '../../../../helpers/users'; class PageHeader extends React.Component { static propTypes = { @@ -51,6 +50,9 @@ class PageHeader extends React.Component { } render () { + const configuration = this.props.project.configuration; + const canApplyPermissionTemplate = configuration != null && configuration.canApplyPermissionTemplate; + return ( <header className="page-header"> <h1 className="page-title"> @@ -61,7 +63,7 @@ class PageHeader extends React.Component { <i className="spinner"/> )} - {isUserAdmin(this.props.currentUser) && ( + {canApplyPermissionTemplate && ( <div className="page-actions"> <button className="js-apply-template" onClick={this.handleApplyTemplate}> Apply Template |