import CatalogItemsActions from '../actions/CatalogItemsActions'
import CommonUtils from 'utils/utils.js'
import FileManagerActions from './filemanager/FileManagerActions';
+import {SkyquakeRBAC, isRBACValid} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx';
+import ROLES from 'utils/roleConstants.js';
+
import 'normalize.css'
import '../styles/AppRoot.scss'
import 'style/layout.scss'
const preventDefault = e => e.preventDefault();
const clearDragState = () => ComposerAppActions.setDragState(null);
+const PROJECT_ROLES = ROLES.PROJECT;
+const PLATFORM = ROLES.PLATFORM;
const ComposerApp = React.createClass({
mixins: [PureRenderMixin],
getDefaultProps() {
return {};
},
+ contextTypes: {
+ router: React.PropTypes.object,
+ userProfile: React.PropTypes.object
+ },
componentWillMount() {
if (clearLocalStorage) {
window.localStorage.clear();
render() {
let html = null;
let self = this;
+ const User = this.context.userProfile || {};
+ const rbacDisabled = !isRBACValid(User, [PROJECT_ROLES.CAT_ADMIN]);
if(this.state.hasModel) {
function onClickUpdateSelection(event) {
<CatalogPanel layout={self.state.layout}
isLoading={isLoading}
hasNoCatalogs={hasNoCatalogs}
- filterByType={self.state.filterCatalogByTypeValue} />
+ filterByType={self.state.filterCatalogByTypeValue}
+ rbacDisabled={rbacDisabled} />
<CanvasPanel layout={self.state.layout}
hasNoCatalogs={hasNoCatalogs}
showMore={self.state.showMore}
newPathName={self.state.newPathName}
item={self.state.item}
type={self.state.filterCatalogByTypeValue}
+ rbacDisabled={rbacDisabled}
/>
{
(self.state.panelTabShown == 'descriptor') ?
isEditingVNFD={isEditingVNFD}
isModified={isModified}
isNew={isNew}
- disabled={!hasItem}
+ disabled={!hasItem || rbacDisabled}
onClick={event => event.stopPropagation()}
panelTabShown={self.state.panelTabShown}/>
</div>
});
+
export default ComposerApp;