Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions lib/admin/components/ProjectAccessSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, {Component} from 'react'
import {Row, Col, Checkbox, ButtonGroup} from 'react-bootstrap'

import OptionButton from '../../common/components/OptionButton'
import {getComponentMessages} from '../../common/util/config'
import {getComponentMessages, isModuleEnabled} from '../../common/util/config'
import * as feedActions from '../../manager/actions/feeds'
import allPermissions from './permissions'

Expand Down Expand Up @@ -132,16 +132,19 @@ export default class ProjectAccessSettings extends Component<Props, State> {
</Col>
<Col xs={6}>
<h4>{this.messages('permissions')}</h4>
{allPermissions.map((permission, i) => (
<Checkbox
// $FlowFixMe
inputRef={ref => { this[`permission-${permission.type}`] = ref }}
key={permission.type}
checked={settings.permissions.indexOf(permission.type) !== -1}
onChange={this.permissionsUpdated}>
{permission.name}
</Checkbox>
))}
{allPermissions
.filter(permission => permission.module ? isModuleEnabled(permission.module) : true)
.map((permission, i) => (
<Checkbox
// $FlowFixMe
inputRef={ref => { this[`permission-${permission.type}`] = ref }}
key={permission.type}
checked={settings.permissions.indexOf(permission.type) !== -1}
onChange={this.permissionsUpdated}>
{permission.name}
</Checkbox>
))
}
</Col>
</Row>
: ''
Expand Down
21 changes: 4 additions & 17 deletions lib/admin/components/permissions.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// @flow

export default [
/* {
type: 'administer-project',
name: 'Administer Project',
feedSpecific: false
}, */
{
type: 'manage-feed',
name: 'Manage Feed Configuration',
Expand All @@ -24,21 +19,13 @@ export default [
{
type: 'edit-alert',
name: 'Edit GTFS-RT Alerts',
feedSpecific: true
feedSpecific: true,
module: 'alerts'
},
{
type: 'approve-alert',
name: 'Approve GTFS-RT Alerts',
feedSpecific: true
},
{
type: 'edit-etid',
name: 'Edit eTID Configurations',
feedSpecific: true
},
{
type: 'approve-etid',
name: 'Approve eTID Configurations',
feedSpecific: true
feedSpecific: true,
module: 'alerts'
}
]