1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

adjust table acl filtered

This commit is contained in:
Tim Daubenschütz 2015-07-13 19:46:06 +02:00
parent 2d28c00d0f
commit f225ee4232
2 changed files with 6 additions and 5 deletions

View File

@ -162,8 +162,7 @@ let AccordionListItemTableEditions = React.createClass({
new ColumnModel(
(item) => {
let content = item.acl;
if (item.request_action){
// TODO should request be translated?
if (item.request_action) {
content = [item.request_action + ' request'];
}
return {

View File

@ -9,12 +9,14 @@ let TableItemAclFiltered = React.createClass({
},
render() {
var availableAcls = ['consign', 'loan', 'transfer', 'view', 'consign request', 'unconsign request', 'loan request'];
var availableAcls = ['acl_consign', 'acl_loan', 'acl_transfer', 'acl_view', 'acl_share', 'acl_unshare'];
let filteredAcls = this.props.content.filter((v) => {
return availableAcls.indexOf(v) > -1;
let filteredAcls = Object.keys(this.props.content).filter((key) => {
return availableAcls.indexOf(key) > -1 && this.props.content[key];
});
filteredAcls = filteredAcls.map((acl) => acl.split('acl_')[1]);
return (
<span>
{filteredAcls.join('/')}