Render SuperAdmin column in Chronograf Admin Table based on Authorization
parent
dafaed6531
commit
b432a12edd
|
@ -1,5 +1,7 @@
|
|||
import React, {PropTypes} from 'react'
|
||||
|
||||
import Authorized, {SUPERADMIN_ROLE} from 'src/auth/Authorized'
|
||||
|
||||
import Dropdown from 'shared/components/Dropdown'
|
||||
|
||||
import {
|
||||
|
@ -79,9 +81,11 @@ const OrgTableRow = ({
|
|||
: 'N/A'}
|
||||
</span>
|
||||
</td>
|
||||
<td style={{width: colSuperAdmin}}>
|
||||
{user.superadmin ? 'Yes' : '--'}
|
||||
</td>
|
||||
<Authorized requiredRole={SUPERADMIN_ROLE}>
|
||||
<td style={{width: colSuperAdmin}}>
|
||||
{user.superadmin ? 'Yes' : '--'}
|
||||
</td>
|
||||
</Authorized>
|
||||
<td style={{width: colProvider}}>
|
||||
{user.provider}
|
||||
</td>
|
||||
|
|
|
@ -2,6 +2,8 @@ import React, {Component, PropTypes} from 'react'
|
|||
|
||||
import _ from 'lodash'
|
||||
|
||||
import Authorized, {SUPERADMIN_ROLE} from 'src/auth/Authorized'
|
||||
|
||||
import UsersTableRow from 'src/admin/components/chronograf/UsersTableRow'
|
||||
import OrgTableRow from 'src/admin/components/chronograf/OrgTableRow'
|
||||
|
||||
|
@ -54,7 +56,9 @@ class ChronografUsersTable extends Component {
|
|||
<th>Username</th>
|
||||
<th style={{width: colOrg}}>Organization</th>
|
||||
<th style={{width: colRole}}>Role</th>
|
||||
<th style={{width: colSuperAdmin}}>SuperAdmin</th>
|
||||
<Authorized requiredRole={SUPERADMIN_ROLE}>
|
||||
<th style={{width: colSuperAdmin}}>SuperAdmin</th>
|
||||
</Authorized>
|
||||
<th style={{width: colProvider}}>Provider</th>
|
||||
<th className="text-right" style={{width: colScheme}}>
|
||||
Scheme
|
||||
|
|
Loading…
Reference in New Issue