X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FCatalogItemDetailsEditor.js;h=fe47521803cd97f32859b3445b82a76fee3458f8;hp=752d678e7ccf507c973d6654cd6ec7c6add27258;hb=b584e4b139ec4a30a97ea42ff54c76753731d707;hpb=56e55f5efc98e32a1afb3d99d07e9e5b0847a258 diff --git a/skyquake/plugins/composer/src/src/components/CatalogItemDetailsEditor.js b/skyquake/plugins/composer/src/src/components/CatalogItemDetailsEditor.js index 752d678e7..fe4752180 100644 --- a/skyquake/plugins/composer/src/src/components/CatalogItemDetailsEditor.js +++ b/skyquake/plugins/composer/src/src/components/CatalogItemDetailsEditor.js @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,6 +20,10 @@ import React from 'react' import PureRenderMixin from 'react-addons-pure-render-mixin' import EditDescriptorModelProperties from './EditDescriptorModelProperties' +import {SkyquakeRBAC, isRBACValid} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; +import ROLES from 'utils/roleConstants.js'; +const PROJECT_ROLES = ROLES.PROJECT; +const PLATFORM = ROLES.PLATFORM; const CatalogItemDetailsEditor = React.createClass({ mixins: [PureRenderMixin], @@ -32,6 +36,10 @@ const CatalogItemDetailsEditor = React.createClass({ width: 0 }; }, + contextTypes: { + router: React.PropTypes.object, + userProfile: React.PropTypes.object + }, componentWillMount() { }, componentDidMount() { @@ -41,6 +49,7 @@ const CatalogItemDetailsEditor = React.createClass({ componentWillUnmount() { }, render() { + const User = this.context.userProfile; const container = this.props.container || {model: {}, uiState: {}}; if (!(container && container.model && container.uiState)) { @@ -51,7 +60,11 @@ const CatalogItemDetailsEditor = React.createClass({
- + { + isRBACValid(User, [PROJECT_ROLES.CAT_ADMIN]) ? + + : + }
@@ -60,4 +73,8 @@ const CatalogItemDetailsEditor = React.createClass({ } }); +CatalogItemDetailsEditor.contextTypes = { + router: React.PropTypes.object, + userProfile: React.PropTypes.object +}; export default CatalogItemDetailsEditor;