GUI Launch form: 'friendly url' option is available only for administrators
@@ -120,6 +120,7 @@ function getFormItemClassName (rootClass, key) {
'dockerRegistries'
)
@localization.localizedComponent
+@roleModel.authenticationInfo
@observer
class LaunchPipelineForm extends localization.LocalizedReactComponent {
localizedStringWithSpotDictionaryFn = (key) => {
@@ -143,6 +144,13 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
return currentConfiguration && currentConfiguration.executionEnvironment === DTS_ENVIRONMENT;
};
+ isAdmin = () => {
+ if (!this.props.authenticatedUserInfo.loaded) {
+ return false;
+ }
+ return this.props.authenticatedUserInfo.value.admin;
+ };
+
static propTypes = {
pipeline: PropTypes.shape(),
pipelines: PropTypes.array,
@@ -2700,7 +2708,7 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
};
renderPrettyUrlFormItem = () => {
- if (this.prettyUrlEnabled) {
+ if (this.prettyUrlEnabled && this.isAdmin()) {
return (
<FormItem
className={getFormItemClassName(styles.formItemRow, 'prettyUrl')}
