1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00

Merge pull request #42 from ascribe/AD-1434-hide-actions-in-detail-pages-if-they-re-not-available

Display actions only if ACLs are available
This commit is contained in:
Tim Daubenschütz 2015-12-07 10:49:07 +01:00
commit 2130b74a96
2 changed files with 12 additions and 2 deletions

View File

@ -222,7 +222,12 @@ let EditionSummary = React.createClass({
value={ edition.owner } />
<LicenseDetail license={edition.license_type}/>
{this.getStatus()}
<AclProxy show={currentUser && currentUser.email}>
{/*
`acl_view` is always available in `edition.acl`, therefore if it has
no more than 1 key, we're hiding the `DetailProperty` actions as otherwise
`AclInformation` would show up
*/}
<AclProxy show={currentUser && currentUser.email && Object.keys(edition.acl).length > 1}>
<EditionDetailProperty
label={getLangText('ACTIONS')}>
<EditionActionPanel

View File

@ -203,7 +203,12 @@ let PieceContainer = React.createClass({
} else {
return (
<AclProxy
show={currentUser && currentUser.email}>
show={currentUser && currentUser.email && Object.keys(piece.acl).length > 1}>
{/*
`acl_view` is always available in `edition.acl`, therefore if it has
no more than 1 key, we're hiding the `DetailProperty` actions as otherwise
`AclInformation` would show up
*/}
<DetailProperty label={getLangText('ACTIONS')}>
<AclButtonList
className="ascribe-button-list"