1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 00:28:00 +02:00

add acl for update button in ContractSettings

This commit is contained in:
Tim Daubenschütz 2015-09-23 16:09:12 +02:00
parent 74e7c9a3d9
commit a6f09c8f35

View File

@ -11,6 +11,9 @@ import ContractListActions from '../../actions/contract_list_actions';
import UserStore from '../../stores/user_store'; import UserStore from '../../stores/user_store';
import UserActions from '../../actions/user_actions'; import UserActions from '../../actions/user_actions';
import WhitelabelStore from '../../stores/whitelabel_store';
import WhitelabelActions from '../../actions/whitelabel_actions';
import ActionPanel from '../ascribe_panel/action_panel'; import ActionPanel from '../ascribe_panel/action_panel';
import ContractSettingsUpdateButton from './contract_settings_update_button'; import ContractSettingsUpdateButton from './contract_settings_update_button';
@ -34,12 +37,15 @@ let ContractSettings = React.createClass({
componentDidMount() { componentDidMount() {
ContractListStore.listen(this.onChange); ContractListStore.listen(this.onChange);
UserStore.listen(this.onChange); UserStore.listen(this.onChange);
WhitelabelStore.listen(this.onChange);
WhitelabelActions.fetchWhitelabel();
UserActions.fetchCurrentUser(); UserActions.fetchCurrentUser();
ContractListActions.fetchContractList(true); ContractListActions.fetchContractList(true);
}, },
componentWillUnmount() { componentWillUnmount() {
WhitelabelStore.unlisten(this.onChange);
UserStore.unlisten(this.onChange); UserStore.unlisten(this.onChange);
ContractListStore.unlisten(this.onChange); ContractListStore.unlisten(this.onChange);
}, },
@ -106,7 +112,11 @@ let ContractSettings = React.createClass({
content={contract.name} content={contract.name}
buttons={ buttons={
<div className="pull-right"> <div className="pull-right">
<ContractSettingsUpdateButton contract={contract}/> <AclProxy
aclObject={this.state.whitelabel}
aclName="acl_update_public_contract">
<ContractSettingsUpdateButton contract={contract}/>
</AclProxy>
<a <a
className="btn btn-default btn-sm margin-left-2px" className="btn btn-default btn-sm margin-left-2px"
href={contract.blob.url_safe} href={contract.blob.url_safe}
@ -144,7 +154,11 @@ let ContractSettings = React.createClass({
content={contract.name} content={contract.name}
buttons={ buttons={
<div className="pull-right"> <div className="pull-right">
<ContractSettingsUpdateButton contract={contract} /> <AclProxy
aclObject={this.state.whitelabel}
aclName="acl_update_private_contract">
<ContractSettingsUpdateButton contract={contract}/>
</AclProxy>
<a <a
className="btn btn-default btn-sm margin-left-2px" className="btn btn-default btn-sm margin-left-2px"
href={contract.blob.url_safe} href={contract.blob.url_safe}