X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Faccounts%2Fsrc%2Faccount%2FaccountsDashboard.jsx;h=c95a63f23736006db3ac8087b66ef2b35836cfe8;hb=80097691f3ed0adb4406906ef619c1042c2219ea;hp=f139b474b3f7f37550bf4e40757aced9bc604973;hpb=dfe972ff7c9f7b6b1d730e66b0b2aa8df2ce329b;p=osm%2FUI.git diff --git a/skyquake/plugins/accounts/src/account/accountsDashboard.jsx b/skyquake/plugins/accounts/src/account/accountsDashboard.jsx index f139b474b..c95a63f23 100644 --- a/skyquake/plugins/accounts/src/account/accountsDashboard.jsx +++ b/skyquake/plugins/accounts/src/account/accountsDashboard.jsx @@ -21,6 +21,14 @@ import AppHeader from 'widgets/header/header.jsx'; import AccountStore from './accountStore.js'; import AccountSidebar from '../account_sidebar/accountSidebar.jsx'; import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx'; +import {SkyquakeRBAC, isRBACValid} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; +import ROLES from 'utils/roleConstants.js'; + +const PROJECT_ROLES = ROLES.PROJECT; +const PLATFORM = ROLES.PLATFORM; + +//Delete this line after testing is done +// PROJECT_ROLES.ACCOUNT_ADMIN = ''; import 'style/layout.scss'; class AccountsDashboard extends React.Component { @@ -44,11 +52,12 @@ class AccountsDashboard extends React.Component { render() { let self = this; let html; + let READONLY = !isRBACValid(this.context.userProfile, [PROJECT_ROLES.ACCOUNT_ADMIN]); html = (
- +
- { this.props.children ? React.cloneElement(this.props.children, {store: self.Store, ...self.state}) : 'Edit or Create New Accounts' + { this.props.children ? React.cloneElement(this.props.children, {readonly: READONLY, store: self.Store, ...self.state}) : 'Edit or Create New Accounts' }
@@ -57,7 +66,8 @@ class AccountsDashboard extends React.Component { } } AccountsDashboard.contextTypes = { - router: React.PropTypes.object + router: React.PropTypes.object, + userProfile: React.PropTypes.object }; export default SkyquakeComponent(AccountsDashboard);