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

dynamic acl for acl_submit

This commit is contained in:
Tim Daubenschütz 2015-08-28 14:07:29 +02:00
parent 680cc8572f
commit 52ae348e57
2 changed files with 11 additions and 9 deletions

View File

@ -84,11 +84,8 @@ let PieceContainer = React.createClass({
IT SHOULD BE REMOVED AND REPLACED WITH A BETTER SOLUTION ASAP!
ALSO, WE ENABLED THE LOAN BUTTON FOR IKONOTV TO LET THEM LOAN ON A PIECE LEVEL
*/
let subdomain = window.location.host.split('.')[0];
if(subdomain !== 'ikonotv' && state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') {
if(state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') {
let pieceState = mergeOptions({}, state.piece);
pieceState.acl.acl_loan = false;

View File

@ -28,6 +28,7 @@ import DetailProperty from '../../../../../ascribe_detail/detail_property';
import GlobalNotificationModel from '../../../../../../models/global_notification_model';
import GlobalNotificationActions from '../../../../../../actions/global_notification_actions';
import AclProxy from '../../../../../acl_proxy';
import AppConstants from '../../../../../../constants/application_constants';
@ -99,7 +100,7 @@ let IkonotvPieceContainer = React.createClass({
}
else {
// This is just because we're inserting a custom acl_loan button
//We need to disable the normal acl_loan because we're inserting a custom acl_loan button
let availableAcls;
if(this.state.piece && this.state.piece.acl && typeof this.state.piece.acl.acl_loan !== 'undefined') {
@ -114,10 +115,14 @@ let IkonotvPieceContainer = React.createClass({
availableAcls={availableAcls}
editions={this.state.piece}
handleSuccess={this.loadPiece}>
<IkonotvSubmitButton
className="btn-sm"
handleSuccess={this.handleSubmitSuccess}
piece={this.state.piece}/>
<AclProxy
aclObject={availableAcls}
aclName="acl_submit">
<IkonotvSubmitButton
className="btn-sm"
handleSuccess={this.handleSubmitSuccess}
piece={this.state.piece}/>
</AclProxy>
<DeleteButton
handleSuccess={this.handleDeleteSuccess}
piece={this.state.piece}/>