Fix queries with start/end shortestpath

master
Rohan Vazarkar 2017-09-28 12:40:26 -04:00
parent 3690a5ad86
commit c29d3c168a
4 changed files with 1283 additions and 1231 deletions

View File

@ -3,342 +3,355 @@ import NodeALink from './NodeALink'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
export default class ComputerNodeData extends Component { export default class ComputerNodeData extends Component {
constructor(){ constructor(){
super(); super();
this.state = { this.state = {
label: "", label: "",
os: "None", os: "None",
unconstrained: "None", unconstrained: "None",
explicitAdmins: -1, explicitAdmins: -1,
unrolledAdmins: -1, unrolledAdmins: -1,
firstDegreeGroupMembership: -1, firstDegreeGroupMembership: -1,
unrolledGroupMembership: -1, unrolledGroupMembership: -1,
firstDegreeLocalAdmin: -1, firstDegreeLocalAdmin: -1,
groupDelegatedLocalAdmin: -1, groupDelegatedLocalAdmin: -1,
derivativeLocalAdmin: -1, derivativeLocalAdmin: -1,
sessions: -1, sessions: -1,
firstdegreeControl: -1, firstdegreeControl: -1,
groupDelegatedControl: -1, groupDelegatedControl: -1,
transitiveControl: -1, transitiveControl: -1,
derivativeLocalAdmins: -1, derivativeLocalAdmins: -1,
driversessions: [] driversessions: []
} }
emitter.on('computerNodeClicked', this.getNodeData.bind(this)); emitter.on('computerNodeClicked', this.getNodeData.bind(this));
} }
getNodeData(payload){ getNodeData(payload){
$.each(this.state.driversessions, function(index, record){ $.each(this.state.driversessions, function(index, record){
record.close(); record.close();
}) })
this.setState({ this.setState({
label: payload, label: payload,
os: "None", os: "None",
unconstrained: "None", unconstrained: "None",
explicitAdmins: -1, explicitAdmins: -1,
unrolledAdmins: -1, unrolledAdmins: -1,
firstDegreeGroupMembership: -1, firstDegreeGroupMembership: -1,
unrolledGroupMembership: -1, unrolledGroupMembership: -1,
sessions: -1, sessions: -1,
firstDegreeLocalAdmin: -1, firstDegreeLocalAdmin: -1,
groupDelegatedLocalAdmin: -1, groupDelegatedLocalAdmin: -1,
derivativeLocalAdmin: -1, derivativeLocalAdmin: -1,
firstdegreeControl: -1, firstdegreeControl: -1,
groupDelegatedControl: -1, groupDelegatedControl: -1,
transitiveControl: -1, transitiveControl: -1,
derivativeLocalAdmins: -1 derivativeLocalAdmins: -1
}) })
var s1 = driver.session() var s1 = driver.session()
var s2 = driver.session() var s2 = driver.session()
var s3 = driver.session() var s3 = driver.session()
var s4 = driver.session() var s4 = driver.session()
var s5 = driver.session() var s5 = driver.session()
var s6 = driver.session() var s6 = driver.session()
var s7 = driver.session() var s7 = driver.session()
var s8 = driver.session() var s8 = driver.session()
var s9 = driver.session() var s9 = driver.session()
var s10 = driver.session() var s10 = driver.session()
var s11 = driver.session() var s11 = driver.session()
var s12 = driver.session() var s12 = driver.session()
var s13 = driver.session() var s13 = driver.session()
s1.run("MATCH (a)-[b:AdminTo]->(c:Computer {name:{name}}) RETURN count(a)", {name:payload}) s1.run("MATCH (a)-[b:AdminTo]->(c:Computer {name:{name}}) RETURN count(a)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'explicitAdmins':result.records[0]._fields[0].low}) this.setState({'explicitAdmins':result.records[0]._fields[0].low})
s1.close() s1.close()
}.bind(this)) }.bind(this))
s2.run("MATCH p=(n:User)-[r:MemberOf|AdminTo*1..]->(m:Computer {name:{name}}) RETURN count(distinct(n))", {name:payload}) s2.run("MATCH p=(n:User)-[r:MemberOf|AdminTo*1..]->(m:Computer {name:{name}}) RETURN count(distinct(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledAdmins':result.records[0]._fields[0].low}) this.setState({'unrolledAdmins':result.records[0]._fields[0].low})
s2.close() s2.close()
}.bind(this)) }.bind(this))
s3.run("MATCH (m:Computer {name:{name}}), (n:Computer), (m)-[r:AdminTo]->(n) RETURN count(distinct(m))", {name:payload}) s3.run("MATCH (m:Computer {name:{name}}), (n:Computer), (m)-[r:AdminTo]->(n) RETURN count(distinct(m))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeLocalAdmin':result.records[0]._fields[0].low}) this.setState({'firstDegreeLocalAdmin':result.records[0]._fields[0].low})
s3.close() s3.close()
}.bind(this)) }.bind(this))
s4.run("MATCH p=(n:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c2:Computer) RETURN count(c2)", {name:payload}) s4.run("MATCH p=(n:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c2:Computer) RETURN count(c2)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'groupDelegatedLocalAdmin':result.records[0]._fields[0].low}) this.setState({'groupDelegatedLocalAdmin':result.records[0]._fields[0].low});
s4.close() s4.close();
}.bind(this)) }.bind(this))
s5.run("MATCH (n:Computer {name:{name}}), (m:Computer), p=shortestPath((n)-[r:AdminTo|MemberOf*1..]->(m)) RETURN count(distinct(m))", {name:payload}) s5.run("MATCH (n:Computer {name:{name}}), (m:Computer) WHERE NOT m.name={name} MATCH p=shortestPath((n)-[r:AdminTo|MemberOf*1..]->(m)) RETURN count(distinct(m))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'derivativeLocalAdmin':result.records[0]._fields[0].low}) this.setState({'derivativeLocalAdmin':result.records[0]._fields[0].low})
s5.close() s5.close()
}.bind(this)) }.bind(this))
s6.run("MATCH (n:Computer {name:{name}}),(target:Group), (n)-[r:MemberOf]->(target) RETURN count(target)", {name:payload}) s6.run("MATCH (n:Computer {name:{name}}),(target:Group), (n)-[r:MemberOf]->(target) RETURN count(target)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeGroupMembership':result.records[0]._fields[0].low}) this.setState({'firstDegreeGroupMembership':result.records[0]._fields[0].low})
s6.close() s6.close()
}.bind(this)) }.bind(this))
s7.run("MATCH p = (c:Computer {name:{name}})-[r:MemberOf*1..]->(g:Group) RETURN COUNT(DISTINCT(g))", {name:payload}) s7.run("MATCH p = (c:Computer {name:{name}})-[r:MemberOf*1..]->(g:Group) RETURN COUNT(DISTINCT(g))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledGroupMembership':result.records[0]._fields[0].low}) this.setState({'unrolledGroupMembership':result.records[0]._fields[0].low})
s7.close() s7.close()
}.bind(this)) }.bind(this))
s8.run("MATCH (m:Computer {name:{name}})-[r:HasSession]->(n:User) WITH n,r,m WHERE NOT n.name ENDS WITH '$' RETURN COUNT(DISTINCT(n))", {name:payload}) s8.run("MATCH (m:Computer {name:{name}})-[r:HasSession]->(n:User) WITH n,r,m WHERE NOT n.name ENDS WITH '$' RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'sessions':result.records[0]._fields[0].low}) this.setState({'sessions':result.records[0]._fields[0].low})
s8.close() s8.close()
}.bind(this)) }.bind(this))
s9.run("MATCH p = shortestPath((n)-[r:AdminTo|MemberOf|HasSession*1..]->(m:Computer {name:{name}})) RETURN COUNT(DISTINCT(n))", {name:payload}) s9.run("MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((n)-[r:AdminTo|MemberOf|HasSession*1..]->(m:Computer {name:{name}})) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'derivativeLocalAdmins':result.records[0]._fields[0].low}) this.setState({'derivativeLocalAdmins':result.records[0]._fields[0].low})
s9.close() s9.close()
}.bind(this)) }.bind(this))
s10.run("MATCH p = (c:Computer {name:{name}})-[r:MemberOf*1..]->(g:Group) WHERE NOT g.domain = c.domain RETURN COUNT(DISTINCT(g))", {name:payload}) s10.run("MATCH p = (c:Computer {name:{name}})-[r:MemberOf*1..]->(g:Group) WHERE NOT g.domain = c.domain RETURN COUNT(DISTINCT(g))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'foreignGroupMembership':result.records[0]._fields[0].low}) this.setState({'foreignGroupMembership':result.records[0]._fields[0].low})
s10.close() s10.close()
}.bind(this)) }.bind(this))
s11.run("MATCH p = (c:Computer {name:{name}})-[r:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload}) s11.run("MATCH p = (c:Computer {name:{name}})-[r:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstdegreeControl':result.records[0]._fields[0].low}) this.setState({'firstdegreeControl':result.records[0]._fields[0].low})
s11.close() s11.close()
}.bind(this)) }.bind(this))
s12.run("MATCH p = (c:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload}) s12.run("MATCH p = (c:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'groupDelegatedControl':result.records[0]._fields[0].low}) this.setState({'groupDelegatedControl':result.records[0]._fields[0].low})
s12.close() s12.close()
}.bind(this)) }.bind(this))
s13.run("MATCH p = shortestPath((c:Computer {name:{name}})-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN COUNT(DISTINCT(n))", {name:payload}) s13.run("MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((c:Computer {name:{name}})-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'transitiveControl':result.records[0]._fields[0].low}) this.setState({'transitiveControl':result.records[0]._fields[0].low})
s13.close() s13.close()
}.bind(this)) }.bind(this))
this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13]}) this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13]})
} }
render() { render() {
return ( return (
<div className={this.props.visible ? "" : "displaynone"}> <div className={this.props.visible ? "" : "displaynone"}>
<dl className='dl-horizontal'> <dl className='dl-horizontal'>
<h4>Node Info</h4> <h4>Node Info</h4>
<dt> <dt>
Name Name
</dt> </dt>
<dd> <dd>
{this.state.label} {this.state.label}
</dd> </dd>
<dt> <dt>
OS OS
</dt> </dt>
<dd> <dd>
{this.state.os} {this.state.os}
</dd> </dd>
<dt> <dt>
Allows Unconstrained Delegation Allows Unconstrained Delegation
</dt> </dt>
<dd> <dd>
{this.state.unconstrained} {this.state.unconstrained}
</dd> </dd>
<dt> <dt>
Sessions Sessions
</dt> </dt>
<dd> <dd>
<NodeALink <NodeALink
ready={this.state.sessions !== -1} ready={this.state.sessions !== -1}
value={this.state.sessions} value={this.state.sessions}
click={function(){ click={function(){
emitter.emit('query', emitter.emit('query',
"MATCH (m:Computer {name:{name}})-[r:HasSession]->(n:User) WITH n,r,m WHERE NOT n.name ENDS WITH '$' RETURN n,r,m", {name: this.state.label}) "MATCH (m:Computer {name:{name}})-[r:HasSession]->(n:User) WITH n,r,m WHERE NOT n.name ENDS WITH '$' RETURN n,r,m", {name: this.state.label})
}.bind(this)} /> }.bind(this)}
</dd> />
<br /> </dd>
<h4>Local Admins</h4> <br />
<dt> <h4>Local Admins</h4>
Explicit Admins <dt>
</dt> Explicit Admins
<dd> </dt>
<NodeALink <dd>
ready={this.state.explicitAdmins !== -1} <NodeALink
value={this.state.explicitAdmins} ready={this.state.explicitAdmins !== -1}
click={function(){ value={this.state.explicitAdmins}
emitter.emit('query', click={function(){
"MATCH (n)-[r:AdminTo]->(m:Computer {name:{name}}) RETURN n,r,m",{name: this.state.label}) emitter.emit('query',
}.bind(this)} /> "MATCH (n)-[r:AdminTo]->(m:Computer {name:{name}}) RETURN n,r,m",{name: this.state.label})
</dd> }.bind(this)}
<dt> />
Unrolled Admins </dd>
</dt> <dt>
<dd> Unrolled Admins
<NodeALink </dt>
ready={this.state.unrolledAdmins !== -1} <dd>
value={this.state.unrolledAdmins} <NodeALink
click={function(){ ready={this.state.unrolledAdmins !== -1}
emitter.emit('query', value={this.state.unrolledAdmins}
"MATCH p = (n:User)-[r:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c:Computer {name:{name}}) RETURN p", click={function(){
{name: this.state.label}, emitter.emit('query',
this.state.label) "MATCH p = (n:User)-[r:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c:Computer {name:{name}}) RETURN p",
}.bind(this)} /> {name: this.state.label},
</dd> this.state.label)
<dt> }.bind(this)}
Derivative Local Admins />
</dt> </dd>
<dd> <dt>
<NodeALink Derivative Local Admins
ready={this.state.derivativeLocalAdmins !== -1} </dt>
value={this.state.derivativeLocalAdmins} <dd>
click={function(){ <NodeALink
emitter.emit('query', ready={this.state.derivativeLocalAdmins !== -1}
"MATCH p = shortestPath((n)-[r:AdminTo|MemberOf|HasSession*1..]->(m:Computer {name:{name}})) RETURN p",{name: this.state.label}, this.state.label) value={this.state.derivativeLocalAdmins}
}.bind(this)} /> click={function(){
</dd> emitter.emit('query',
<br /> "MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((n)-[r:AdminTo|MemberOf|HasSession*1..]->(m:Computer {name:{name}})) RETURN p",{name: this.state.label}, this.state.label)
<h4>Group Memberships</h4> }.bind(this)}
<dt> />
First Degree Group Membership </dd>
</dt> <br />
<dd> <h4>Group Memberships</h4>
<NodeALink <dt>
ready={this.state.firstDegreeGroupMembership !== -1} First Degree Group Membership
value={this.state.firstDegreeGroupMembership} </dt>
click={function(){ <dd>
emitter.emit('query', <NodeALink
"MATCH (n:Computer {name:{name}}),(m:Group), (n)-[r:MemberOf]->(m) RETURN n,r,m",{name: this.state.label}, this.state.label) ready={this.state.firstDegreeGroupMembership !== -1}
}.bind(this)} /> value={this.state.firstDegreeGroupMembership}
</dd> click={function(){
<dt> emitter.emit('query',
Unrolled Group Membership "MATCH (n:Computer {name:{name}}),(m:Group), (n)-[r:MemberOf]->(m) RETURN n,r,m",{name: this.state.label}, this.state.label)
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.unrolledGroupMembership !== -1} <dt>
value={this.state.unrolledGroupMembership} Unrolled Group Membership
click={function(){ </dt>
emitter.emit('query', <dd>
"MATCH p = (n:Computer {name:{name}})-[r:MemberOf*1..]->(m:Group) RETURN p",{name: this.state.label}, this.state.label) <NodeALink
}.bind(this)} /> ready={this.state.unrolledGroupMembership !== -1}
</dd> value={this.state.unrolledGroupMembership}
<dt> click={function(){
Foreign Group Membership emitter.emit('query',
</dt> "MATCH p = (n:Computer {name:{name}})-[r:MemberOf*1..]->(m:Group) RETURN p",{name: this.state.label}, this.state.label)
<dd> }.bind(this)}
<NodeALink />
ready={this.state.foreignGroupMembership !== -1} </dd>
value={this.state.foreignGroupMembership} <dt>
click={function(){ Foreign Group Membership
emitter.emit('query', </dt>
"MATCH p = (c:Computer {name:{name}})-[r:MemberOf*1..]->(g:Group) WHERE NOT g.domain = c.domain RETURN p",{name: this.state.label}, this.state.label) <dd>
}.bind(this)} /> <NodeALink
</dd> ready={this.state.foreignGroupMembership !== -1}
<br /> value={this.state.foreignGroupMembership}
<h4>Local Admin Rights</h4> click={function(){
<dt> emitter.emit('query',
First Degree Local Admin "MATCH p = (c:Computer {name:{name}})-[r:MemberOf*1..]->(g:Group) WHERE NOT g.domain = c.domain RETURN p",{name: this.state.label}, this.state.label)
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.firstDegreeLocalAdmin !== -1} <br />
value={this.state.firstDegreeLocalAdmin} <h4>Local Admin Rights</h4>
click={function(){ <dt>
emitter.emit('query', First Degree Local Admin
"MATCH (n:Computer {name:{name}}), (m:Computer), p=(n)-[r:AdminTo]->(m) RETURN p",{name: this.state.label}, this.state.label) </dt>
}.bind(this)} /> <dd>
</dd> <NodeALink
<dt> ready={this.state.firstDegreeLocalAdmin !== -1}
Group Delegated Local Admin value={this.state.firstDegreeLocalAdmin}
</dt> click={function(){
<dd> emitter.emit('query',
<NodeALink "MATCH (n:Computer {name:{name}}), (m:Computer), p=(n)-[r:AdminTo]->(m) RETURN p",{name: this.state.label}, this.state.label)
ready={this.state.groupDelegatedLocalAdmin !== -1} }.bind(this)}
value={this.state.groupDelegatedLocalAdmin} />
click={function(){ </dd>
emitter.emit('query', <dt>
"MATCH p=(n:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(m:Computer) RETURN p",{name: this.state.label}, this.state.label) Group Delegated Local Admin
}.bind(this)} /> </dt>
</dd> <dd>
<dt> <NodeALink
Derivative Local Admin ready={this.state.groupDelegatedLocalAdmin !== -1}
</dt> value={this.state.groupDelegatedLocalAdmin}
<dd> click={function(){
<NodeALink emitter.emit('query',
ready={this.state.derivativeLocalAdmin !== -1} "MATCH p=(n:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(m:Computer) RETURN p",{name: this.state.label}, this.state.label)
value={this.state.derivativeLocalAdmin} }.bind(this)}
click={function(){ />
emitter.emit('query', </dd>
"MATCH p = shortestPath((c1:Computer {name:{name}})-[r:AdminTo|MemberOf|HasSession*1..]->(c:Computer)) RETURN p",{name: this.state.label}, this.state.label) <dt>
}.bind(this)} /> Derivative Local Admin
</dd> </dt>
<br /> <dd>
<h4>Outbound Object Control</h4> <NodeALink
<dt> ready={this.state.derivativeLocalAdmin !== -1}
First Degree Object Control value={this.state.derivativeLocalAdmin}
</dt> click={function(){
<dd> emitter.emit('query',
<NodeALink "MATCH (c:Computer) WHERE NOT c.name={name} WITH c MATCH p = shortestPath((c1:Computer {name:{name}})-[r:AdminTo|MemberOf|HasSession*1..]->(c)) RETURN p",{name: this.state.label}, this.state.label);
ready={this.state.firstdegreeControl !== -1} }.bind(this)}
value={this.state.firstdegreeControl} />
click={function(){ </dd>
emitter.emit('query', "MATCH p = (c:Computer {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label}) <br />
}.bind(this)} /> <h4>Outbound Object Control</h4>
</dd> <dt>
<dt> First Degree Object Control
Group Delegated Object Control </dt>
</dt> <dd>
<dd> <NodeALink
<NodeALink ready={this.state.firstdegreeControl !== -1}
ready={this.state.groupDelegatedControl !== -1} value={this.state.firstdegreeControl}
value={this.state.groupDelegatedControl} click={function(){
click={function(){ emitter.emit('query', "MATCH p = (c:Computer {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label})
emitter.emit('query', "MATCH p = (c:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label} }.bind(this)}
,this.state.label) />
}.bind(this)} /> </dd>
</dd> <dt>
<dt> Group Delegated Object Control
Transitive Object Control </dt>
</dt> <dd>
<dd> <NodeALink
<NodeALink ready={this.state.groupDelegatedControl !== -1}
ready={this.state.transitiveControl !== -1} value={this.state.groupDelegatedControl}
value={this.state.transitiveControl} click={function(){
click={function(){ emitter.emit('query', "MATCH p = (c:Computer {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label}
emitter.emit('query', "MATCH p = shortestPath((c:Computer {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN p", {name:this.state.label} ,this.state.label)
,this.state.label) }.bind(this)}
}.bind(this)} /> />
</dd> </dd>
</dl> <dt>
</div> Transitive Object Control
); </dt>
} <dd>
<NodeALink
ready={this.state.transitiveControl !== -1}
value={this.state.transitiveControl}
click={function(){
emitter.emit('query', "MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((c:Computer {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN p", {name:this.state.label}
,this.state.label)
}.bind(this)}
/>
</dd>
</dl>
</div>
);
}
} }
ComputerNodeData.propTypes= { ComputerNodeData.propTypes= {
visible : React.PropTypes.bool.isRequired visible : React.PropTypes.bool.isRequired
} }

View File

@ -1,233 +1,243 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import NodeALink from './NodeALink.jsx' import NodeALink from './NodeALink.jsx';
import LoadLabel from './LoadLabel.jsx' import LoadLabel from './LoadLabel.jsx';
import PropTypes from 'prop-types' import PropTypes from 'prop-types';
export default class DomainNodeData extends Component { export default class DomainNodeData extends Component {
constructor(){ constructor(){
super(); super();
this.state = { this.state = {
label: "", label: "",
users: -1, users: -1,
groups: -1, groups: -1,
computers: -1, computers: -1,
foreignGroups: -1, foreignGroups: -1,
foreignUsers: -1, foreignUsers: -1,
firstDegreeOutboundTrusts: -1, firstDegreeOutboundTrusts: -1,
effectiveOutboundTrusts: -1, effectiveOutboundTrusts: -1,
firstDegreeInboundTrusts: -1, firstDegreeInboundTrusts: -1,
effectiveInboundTrusts: -1, effectiveInboundTrusts: -1,
driversessions: [] driversessions: []
} };
emitter.on('domainNodeClicked', this.getNodeData.bind(this)); emitter.on('domainNodeClicked', this.getNodeData.bind(this));
} }
getNodeData(payload){ getNodeData(payload){
$.each(this.state.driversessions, function(index, record){ $.each(this.state.driversessions, function(index, record){
record.close(); record.close();
}) });
this.setState({ this.setState({
label: payload, label: payload,
users: -1, users: -1,
groups: -1, groups: -1,
computers: -1, computers: -1,
foreignGroups: -1, foreignGroups: -1,
foreignUsers: -1, foreignUsers: -1,
firstDegreeOutboundTrusts: -1, firstDegreeOutboundTrusts: -1,
effectiveOutboundTrusts: -1, effectiveOutboundTrusts: -1,
firstDegreeInboundTrusts: -1, firstDegreeInboundTrusts: -1,
effectiveInboundTrusts: -1 effectiveInboundTrusts: -1
}) });
var s1 = driver.session() var s1 = driver.session();
var s2 = driver.session() var s2 = driver.session();
var s3 = driver.session() var s3 = driver.session();
var s4 = driver.session() var s4 = driver.session();
var s5 = driver.session() var s5 = driver.session();
var s6 = driver.session() var s6 = driver.session();
var s7 = driver.session() var s7 = driver.session();
var s8 = driver.session() var s8 = driver.session();
var s9 = driver.session() var s9 = driver.session();
s1.run("MATCH (a:User) WHERE a.name ENDS WITH ('@' + {name}) RETURN COUNT(a)", {name:payload}) s1.run("MATCH (a:User) WHERE a.name ENDS WITH ('@' + {name}) RETURN COUNT(a)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'users':result.records[0]._fields[0].low}) this.setState({'users':result.records[0]._fields[0].low});
s1.close() s1.close();
}.bind(this)) }.bind(this));
s2.run("MATCH (a:Group) WHERE a.name ENDS WITH ('@' + {name}) RETURN COUNT(a)", {name:payload}) s2.run("MATCH (a:Group) WHERE a.name ENDS WITH ('@' + {name}) RETURN COUNT(a)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'groups':result.records[0]._fields[0].low}) this.setState({'groups':result.records[0]._fields[0].low});
s2.close() s2.close();
}.bind(this)) }.bind(this));
s3.run("MATCH (n:Computer) WHERE n.name ENDS WITH {name} WITH n WHERE size(split(n.name,'.')) - size(split({name},'.')) = 1 RETURN count(n)", {name:payload}) s3.run("MATCH (n:Computer) WHERE n.name ENDS WITH {name} WITH n WHERE size(split(n.name,'.')) - size(split({name},'.')) = 1 RETURN count(n)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'computers':result.records[0]._fields[0].low}) this.setState({'computers':result.records[0]._fields[0].low});
s3.close() s3.close();
}.bind(this)) }.bind(this));
s4.run("MATCH (a:Group) WHERE NOT a.name ENDS WITH ('@' + {name}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {name}) WITH a,b MATCH (a)-[r:MemberOf]->(b) RETURN count(a)", {name:payload}) s4.run("MATCH (a:Group) WHERE NOT a.name ENDS WITH ('@' + {name}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {name}) WITH a,b MATCH (a)-[r:MemberOf]->(b) RETURN count(a)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'foreignGroups':result.records[0]._fields[0].low}) this.setState({'foreignGroups':result.records[0]._fields[0].low});
s4.close() s4.close();
}.bind(this)) }.bind(this));
s5.run("MATCH (a:User) WHERE NOT a.name ENDS WITH ('@' + {name}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {name}) WITH a,b MATCH (a)-[r:MemberOf]->(b) RETURN count(a)", {name:payload}) s5.run("MATCH (a:User) WHERE NOT a.name ENDS WITH ('@' + {name}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {name}) WITH a,b MATCH (a)-[r:MemberOf]->(b) RETURN count(a)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'foreignUsers':result.records[0]._fields[0].low}) this.setState({'foreignUsers':result.records[0]._fields[0].low});
s5.close() s5.close();
}.bind(this)) }.bind(this));
s6.run("MATCH (a:Domain {name:{name}})<-[r:TrustedBy]-(b:Domain) RETURN count(b)", {name:payload}) s6.run("MATCH (a:Domain {name:{name}})<-[r:TrustedBy]-(b:Domain) RETURN count(b)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeInboundTrusts':result.records[0]._fields[0].low}) this.setState({'firstDegreeInboundTrusts':result.records[0]._fields[0].low});
s6.close() s6.close();
}.bind(this)) }.bind(this));
s7.run("MATCH (a:Domain {name:{name}})-[r:TrustedBy]->(b:Domain) RETURN count(b)", {name:payload}) s7.run("MATCH (a:Domain {name:{name}})-[r:TrustedBy]->(b:Domain) RETURN count(b)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeOutboundTrusts':result.records[0]._fields[0].low}) this.setState({'firstDegreeOutboundTrusts':result.records[0]._fields[0].low});
s7.close() s7.close();
}.bind(this)) }.bind(this));
s8.run("MATCH p=shortestPath((a:Domain {name:{name}})<-[r:TrustedBy*1..]-(b:Domain)) RETURN count(b)", {name:payload}) s8.run("MATCH (b:Domain) WHERE NOT b.name={name} WITH b MATCH p=shortestPath((a:Domain {name:{name}})<-[r:TrustedBy*1..]-(b)) RETURN count(b)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'effectiveInboundTrusts':result.records[0]._fields[0].low}) this.setState({'effectiveInboundTrusts':result.records[0]._fields[0].low});
s8.close() s8.close();
}.bind(this)) }.bind(this));
s9.run("MATCH p=shortestPath((a:Domain {name:{name}})-[r:TrustedBy*1..]->(b:Domain)) RETURN count(b)", {name:payload}) s9.run("MATCH (b:Domain) WHERE NOT b.name={name} MATCH p=shortestPath((a:Domain {name:{name}})-[r:TrustedBy*1..]->(b)) RETURN count(b)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'effectiveOutboundTrusts':result.records[0]._fields[0].low}) this.setState({'effectiveOutboundTrusts':result.records[0]._fields[0].low});
s9.close() s9.close();
}.bind(this)) }.bind(this));
this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9]}) this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9]});
} }
render() { render() {
return ( return (
<div className={this.props.visible ? "" : "displaynone"}> <div className={this.props.visible ? "" : "displaynone"}>
<dl className='dl-horizontal'> <dl className='dl-horizontal'>
<dt> <dt>
Node Node
</dt> </dt>
<dd> <dd>
{this.state.label} {this.state.label}
</dd> </dd>
<br /> <br />
<dt> <dt>
Users Users
</dt> </dt>
<dd> <dd>
<LoadLabel <LoadLabel
ready={this.state.users !== -1} ready={this.state.users !== -1}
value={this.state.users} /> value={this.state.users}
</dd> />
<dt> </dd>
Groups <dt>
</dt> Groups
<dd> </dt>
<LoadLabel <dd>
ready={this.state.groups !== -1} <LoadLabel
value={this.state.groups} /> ready={this.state.groups !== -1}
</dd> value={this.state.groups}
<dt> />
Computers </dd>
</dt> <dt>
<dd> Computers
<LoadLabel </dt>
ready={this.state.computers !== -1} <dd>
value={this.state.computers} /> <LoadLabel
</dd> ready={this.state.computers !== -1}
<br /> value={this.state.computers}
<dt> />
Foreign Users </dd>
</dt> <br />
<dd> <dt>
<NodeALink Foreign Users
ready={this.state.foreignUsers !== -1} </dt>
value={this.state.foreignUsers} <dd>
click={function(){ <NodeALink
emitter.emit('query', "MATCH (a:User) WHERE NOT a.name ENDS WITH ('@' + {domain}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {domain}) WITH a,b MATCH (a)-[r:MemberOf]-(b) RETURN a,r,b", {domain: this.state.label}) ready={this.state.foreignUsers !== -1}
}.bind(this)} /> value={this.state.foreignUsers}
</dd> click={function(){
<dt> emitter.emit('query', "MATCH (a:User) WHERE NOT a.name ENDS WITH ('@' + {domain}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {domain}) WITH a,b MATCH (a)-[r:MemberOf]-(b) RETURN a,r,b", {domain: this.state.label});
Foreign Groups }.bind(this)}
</dt> />
<dd> </dd>
<NodeALink <dt>
ready={this.state.foreignGroups !== -1} Foreign Groups
value={this.state.foreignGroups} </dt>
click={function(){ <dd>
emitter.emit('query', "MATCH (a:Group) WHERE NOT a.name ENDS WITH ('@' + {domain}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {domain}) WITH a,b MATCH (a)-[r:MemberOf]-(b) RETURN a,r,b", {domain: this.state.label}) <NodeALink
}.bind(this)} /> ready={this.state.foreignGroups !== -1}
</dd> value={this.state.foreignGroups}
<dt> click={function(){
Foreign Admins emitter.emit('query', "MATCH (a:Group) WHERE NOT a.name ENDS WITH ('@' + {domain}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {domain}) WITH a,b MATCH (a)-[r:MemberOf]-(b) RETURN a,r,b", {domain: this.state.label});
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.foreignAdmins !== -1} <dt>
value={this.state.foreignAdmins} Foreign Admins
click={function(){ </dt>
emitter.emit('query', "MATCH (a:Group) WHERE NOT a.name ENDS WITH ('@' + {domain}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {domain}) WITH a,b MATCH (a)-[r:MemberOf]-(b) RETURN a,r,b", {domain: this.state.label}) <dd>
}.bind(this)} /> <NodeALink
</dd> ready={this.state.foreignAdmins !== -1}
<br /> value={this.state.foreignAdmins}
<dt> click={function(){
Inbound Trusts emitter.emit('query', "MATCH (a:Group) WHERE NOT a.name ENDS WITH ('@' + {domain}) WITH a MATCH (b:Group) WHERE b.name ENDS WITH ('@' + {domain}) WITH a,b MATCH (a)-[r:MemberOf]-(b) RETURN a,r,b", {domain: this.state.label});
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.firstDegreeInboundTrusts !== -1} <br />
value={this.state.firstDegreeInboundTrusts} <dt>
click={function(){ Inbound Trusts
emitter.emit('query', "MATCH (a:Domain {name:{domain}})<-[r:TrustedBy]-(b:Domain) RETURN a,r,b", {domain: this.state.label}) </dt>
}.bind(this)} /> <dd>
</dd> <NodeALink
<dt> ready={this.state.firstDegreeInboundTrusts !== -1}
Effective Inbound Trusts value={this.state.firstDegreeInboundTrusts}
</dt> click={function(){
<dd> emitter.emit('query', "MATCH (a:Domain {name:{domain}})<-[r:TrustedBy]-(b:Domain) RETURN a,r,b", {domain: this.state.label});
<NodeALink }.bind(this)}
ready={this.state.effectiveInboundTrusts !== -1} />
value={this.state.effectiveInboundTrusts} </dd>
click={function(){ <dt>
emitter.emit('query', "MATCH p=shortestPath((a:Domain {name:{domain}})<-[r:TrustedBy*1..]-(b:Domain)) RETURN p", {domain: this.state.label}) Effective Inbound Trusts
}.bind(this)} /> </dt>
</dd> <dd>
<dt> <NodeALink
Outbound Trusts ready={this.state.effectiveInboundTrusts !== -1}
</dt> value={this.state.effectiveInboundTrusts}
<dd> click={function(){
<NodeALink emitter.emit('query', "MATCH (b:Domain) WHERE NOT b.name={domain} WITH b MATCH p=shortestPath((a:Domain {name:{domain}})<-[r:TrustedBy*1..]-(b)) RETURN p", {domain: this.state.label});
ready={this.state.firstDegreeOutboundTrusts !== -1} }.bind(this)}
value={this.state.firstDegreeOutboundTrusts} />
click={function(){ </dd>
emitter.emit('query', "MATCH (a:Domain {name:{domain}})-[r:TrustedBy]->(b:Domain) RETURN a,r,b", {domain: this.state.label}) <dt>
}.bind(this)} /> Outbound Trusts
</dd> </dt>
<dt> <dd>
Effective Outbound Trusts <NodeALink
</dt> ready={this.state.firstDegreeOutboundTrusts !== -1}
<dd> value={this.state.firstDegreeOutboundTrusts}
<NodeALink click={function(){
ready={this.state.effectiveOutboundTrusts !== -1} emitter.emit('query', "MATCH (a:Domain {name:{domain}})-[r:TrustedBy]->(b:Domain) RETURN a,r,b", {domain: this.state.label});
value={this.state.effectiveOutboundTrusts} }.bind(this)}
click={function(){ />
emitter.emit('query', "MATCH p=shortestPath((a:Domain {name:{domain}})-[r:TrustedBy*1..]->(b:Domain)) RETURN p", {domain: this.state.label}) </dd>
}.bind(this)} /> <dt>
</dd> Effective Outbound Trusts
</dl> </dt>
</div> <dd>
); <NodeALink
} ready={this.state.effectiveOutboundTrusts !== -1}
value={this.state.effectiveOutboundTrusts}
click={function(){
emitter.emit('query', "MATCH (b:Domain) WHERE NOT b.name={domain} WITH b MATCH p=shortestPath((a:Domain {name:{domain}})-[r:TrustedBy*1..]->(b:Domain)) RETURN p", {domain: this.state.label});
}.bind(this)}
/>
</dd>
</dl>
</div>
);
}
} }
DomainNodeData.propTypes = { DomainNodeData.propTypes = {
visible : React.PropTypes.bool.isRequired visible : React.PropTypes.bool.isRequired
} };

View File

@ -1,394 +1,410 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import NodeALink from './NodeALink' import NodeALink from './NodeALink';
import PropTypes from 'prop-types' import PropTypes from 'prop-types';
export default class GroupNodeData extends Component { export default class GroupNodeData extends Component {
constructor(){ constructor(){
super(); super();
this.state = { this.state = {
label: "", label: "",
directMembers: -1, directMembers: -1,
unrolledMembers: -1, unrolledMembers: -1,
directAdminTo: -1, directAdminTo: -1,
derivativeAdminTo: -1, derivativeAdminTo: -1,
unrolledMemberOf: -1, unrolledMemberOf: -1,
sessions: -1, sessions: -1,
foreignGroupMembership: -1, foreignGroupMembership: -1,
foreignGroupMembers: -1, foreignGroupMembers: -1,
firstDegreeGroupMembership: -1, firstDegreeGroupMembership: -1,
groupDelegatedAdmin: -1, groupDelegatedAdmin: -1,
firstdegreeControl: -1, firstdegreeControl: -1,
groupDelegatedControl: -1, groupDelegatedControl: -1,
transitiveControl: -1, transitiveControl: -1,
firstDegreeControllers: -1, firstDegreeControllers: -1,
unrolledControllers: -1, unrolledControllers: -1,
transitiveControllers: -1, transitiveControllers: -1,
driversessions: [] driversessions: []
} };
emitter.on('groupNodeClicked', this.getNodeData.bind(this)); emitter.on('groupNodeClicked', this.getNodeData.bind(this));
} }
getNodeData(payload){ getNodeData(payload){
$.each(this.state.driversessions, function(index, record){ $.each(this.state.driversessions, function(index, record){
record.close(); record.close();
}) });
this.setState({ this.setState({
label: payload, label: payload,
directMembers: -1, directMembers: -1,
unrolledMembers: -1, unrolledMembers: -1,
directAdminTo: -1, directAdminTo: -1,
derivativeAdminTo: -1, derivativeAdminTo: -1,
unrolledMemberOf: -1, unrolledMemberOf: -1,
sessions: -1, sessions: -1,
foreignGroupMembership: -1, foreignGroupMembership: -1,
foreignGroupMembers: -1, foreignGroupMembers: -1,
firstDegreeGroupMembership: -1, firstDegreeGroupMembership: -1,
groupDelegatedAdmin: -1, groupDelegatedAdmin: -1,
firstdegreeControl: -1, firstdegreeControl: -1,
groupDelegatedControl: -1, groupDelegatedControl: -1,
transitiveControl: -1, transitiveControl: -1,
firstDegreeControllers: -1, firstDegreeControllers: -1,
unrolledControllers: -1, unrolledControllers: -1,
transitiveControllers: -1 transitiveControllers: -1
}) });
var domain = '@' + payload.split('@').last() var domain = '@' + payload.split('@').last();
var s1 = driver.session() var s1 = driver.session();
var s2 = driver.session() var s2 = driver.session();
var s3 = driver.session() var s3 = driver.session();
var s4 = driver.session() var s4 = driver.session();
var s5 = driver.session() var s5 = driver.session();
var s6 = driver.session() var s6 = driver.session();
var s7 = driver.session() var s7 = driver.session();
var s8 = driver.session() var s8 = driver.session();
var s9 = driver.session() var s9 = driver.session();
var s10 = driver.session() var s10 = driver.session();
var s11 = driver.session() var s11 = driver.session();
var s12 = driver.session() var s12 = driver.session();
var s13 = driver.session() var s13 = driver.session();
var s14 = driver.session() var s14 = driver.session();
var s15 = driver.session() var s15 = driver.session();
var s16 = driver.session() var s16 = driver.session();
s1.run("MATCH (a)-[b:MemberOf]->(c:Group {name:{name}}) RETURN count(a)", {name:payload}) s1.run("MATCH (a)-[b:MemberOf]->(c:Group {name:{name}}) RETURN count(a)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'directMembers':result.records[0]._fields[0].low}) this.setState({'directMembers':result.records[0]._fields[0].low});
s1.close() s1.close();
}.bind(this)) }.bind(this));
s2.run("MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) RETURN COUNT(n)", {name:payload}) s2.run("MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) RETURN COUNT(n)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledMembers':result.records[0]._fields[0].low}) this.setState({'unrolledMembers':result.records[0]._fields[0].low});
s2.close() s2.close();
}.bind(this)) }.bind(this));
s3.run("MATCH (n:Group {name:{name}})-[r:AdminTo]->(m:Computer) RETURN count(distinct(m))", {name:payload}) s3.run("MATCH (n:Group {name:{name}})-[r:AdminTo]->(m:Computer) RETURN count(distinct(m))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'directAdminTo':result.records[0]._fields[0].low}) this.setState({'directAdminTo':result.records[0]._fields[0].low});
s3.close() s3.close();
}.bind(this)) }.bind(this));
s4.run("MATCH p = shortestPath((g:Group {name:{name}})-[r:MemberOf|AdminTo|HasSession*1..]->(c:Computer)) RETURN COUNT(DISTINCT(c))", {name:payload}) s4.run("MATCH (c:Computer) WHERE NOT c.name={name} WITH c MATCH p = shortestPath((g:Group {name:{name}})-[r:MemberOf|AdminTo|HasSession*1..]->(c)) RETURN COUNT(DISTINCT(c))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'derivativeAdminTo':result.records[0]._fields[0].low}) this.setState({'derivativeAdminTo':result.records[0]._fields[0].low});
s4.close() s4.close();
}.bind(this)) }.bind(this));
s5.run("MATCH p = (g1:Group {name:{name}})-[r:MemberOf*1..]->(g2:Group) RETURN COUNT(DISTINCT(g2))", {name:payload}) s5.run("MATCH p = (g1:Group {name:{name}})-[r:MemberOf*1..]->(g2:Group) RETURN COUNT(DISTINCT(g2))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledMemberOf':result.records[0]._fields[0].low}) this.setState({'unrolledMemberOf':result.records[0]._fields[0].low});
s5.close() s5.close();
}.bind(this)) }.bind(this));
s6.run("MATCH p = (c:Computer)-[r1:HasSession]->(u:User)-[r2:MemberOf*1..]->(g:Group {name: {name}}) RETURN COUNT(r1)", {name:payload}) s6.run("MATCH p = (c:Computer)-[r1:HasSession]->(u:User)-[r2:MemberOf*1..]->(g:Group {name: {name}}) RETURN COUNT(r1)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'sessions':result.records[0]._fields[0].low}) this.setState({'sessions':result.records[0]._fields[0].low});
s6.close() s6.close();
}.bind(this)) }.bind(this));
s7.run("MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:Group {name:{name}}) MATCH (m)-[r:MemberOf]->(n) RETURN count(n)", {name:payload, domain:domain}) s7.run("MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:Group {name:{name}}) MATCH (m)-[r:MemberOf]->(n) RETURN count(n)", {name:payload, domain:domain})
.then(function(result){ .then(function(result){
this.setState({'foreignGroupMembership':result.records[0]._fields[0].low}) this.setState({'foreignGroupMembership':result.records[0]._fields[0].low});
s7.close() s7.close();
}.bind(this)) }.bind(this));
s8.run("MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) WHERE NOT g.domain = n.domain RETURN COUNT(DISTINCT(n))", {name:payload}) s8.run("MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) WHERE NOT g.domain = n.domain RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'foreignGroupMembers':result.records[0]._fields[0].low}) this.setState({'foreignGroupMembers':result.records[0]._fields[0].low});
s8.close() s8.close();
}.bind(this)) }.bind(this));
s9.run("MATCH p = (g1:Group {name:{name}})-[r:MemberOf]->(g2:Group) RETURN COUNT(DISTINCT(g2))", {name:payload}) s9.run("MATCH p = (g1:Group {name:{name}})-[r:MemberOf]->(g2:Group) RETURN COUNT(DISTINCT(g2))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeGroupMembership':result.records[0]._fields[0].low}) this.setState({'firstDegreeGroupMembership':result.records[0]._fields[0].low});
s9.close() s9.close();
}.bind(this)) }.bind(this));
s10.run("MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AdminTo]->(c:Computer) RETURN COUNT(DISTINCT(c))", {name:payload}) s10.run("MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AdminTo]->(c:Computer) RETURN COUNT(DISTINCT(c))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'groupDelegatedAdmin':result.records[0]._fields[0].low}) this.setState({'groupDelegatedAdmin':result.records[0]._fields[0].low});
s10.close() s10.close();
}.bind(this)) }.bind(this));
s11.run("MATCH p = (g:Group {name:{name}})-[r:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload}) s11.run("MATCH p = (g:Group {name:{name}})-[r:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstdegreeControl':result.records[0]._fields[0].low}) this.setState({'firstdegreeControl':result.records[0]._fields[0].low});
s11.close() s11.close();
}.bind(this)) }.bind(this));
s12.run("MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload}) s12.run("MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'groupDelegatedControl':result.records[0]._fields[0].low}) this.setState({'groupDelegatedControl':result.records[0]._fields[0].low});
s12.close() s12.close();
}.bind(this)) }.bind(this));
s13.run("MATCH p = shortestPath((g:Group {name:{name}})-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN COUNT(DISTINCT(n))", {name:payload}) s13.run("MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((g:Group {name:{name}})-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'transitiveControl':result.records[0]._fields[0].low}) this.setState({'transitiveControl':result.records[0]._fields[0].low});
s13.close() s13.close();
}.bind(this)) }.bind(this));
s14.run("MATCH p = (n)-[r:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g:Group {name:{name}}) RETURN COUNT(DISTINCT(n))", {name:payload}) s14.run("MATCH p = (n)-[r:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g:Group {name:{name}}) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeControllers':result.records[0]._fields[0].low}) this.setState({'firstDegreeControllers':result.records[0]._fields[0].low});
s14.close() s14.close();
}.bind(this)) }.bind(this));
s15.run("MATCH p = (n1)-[r:MemberOf*1..]->(g1:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g2:Group {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = g2.name) AND NOT n1.name = g2.name RETURN COUNT(DISTINCT(n1))", {name:payload}) s15.run("MATCH p = (n1)-[r:MemberOf*1..]->(g1:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g2:Group {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = g2.name) AND NOT n1.name = g2.name RETURN COUNT(DISTINCT(n1))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledControllers':result.records[0]._fields[0].low}) this.setState({'unrolledControllers':result.records[0]._fields[0].low});
s15.close() s15.close();
}.bind(this)) }.bind(this));
s16.run("MATCH p = shortestPath((n)-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(g:Group {name:{name}})) RETURN COUNT(DISTINCT(n))", {name:payload}) s16.run("MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((n)-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(g:Group {name:{name}})) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'transitiveControllers':result.records[0]._fields[0].low}) this.setState({'transitiveControllers':result.records[0]._fields[0].low});
s16.close() s16.close();
}.bind(this)) }.bind(this));
this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16]}) this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16]});
} }
render() { render() {
var domain = '@' + this.state.label.split('@') var domain = '@' + this.state.label.split('@');
return ( return (
<div className={this.props.visible ? "" : "displaynone"}> <div className={this.props.visible ? "" : "displaynone"}>
<dl className='dl-horizontal'> <dl className='dl-horizontal'>
<h4>Node Info</h4> <h4>Node Info</h4>
<dt> <dt>
Name Name
</dt> </dt>
<dd> <dd>
{this.state.label} {this.state.label}
</dd> </dd>
<dt> <dt>
Sessions Sessions
</dt> </dt>
<dd> <dd>
<NodeALink <NodeALink
ready={this.state.sessions !== -1} ready={this.state.sessions !== -1}
value={this.state.sessions} value={this.state.sessions}
click={function(){ click={function(){
emitter.emit('query', "MATCH p = (c:Computer)-[r1:HasSession]->(u:User)-[r2:MemberOf*1..]->(g:Group {name: {name}}) RETURN p", {name: this.state.label}, emitter.emit('query', "MATCH p = (c:Computer)-[r1:HasSession]->(u:User)-[r2:MemberOf*1..]->(g:Group {name: {name}}) RETURN p", {name: this.state.label},
"",this.state.label) "",this.state.label);
}.bind(this)} /> }.bind(this)}
</dd> />
<br /> </dd>
<h4>Group Members</h4> <br />
<dt> <h4>Group Members</h4>
Direct Members <dt>
</dt> Direct Members
<dd> </dt>
<NodeALink <dd>
ready={this.state.directMembers !== -1} <NodeALink
value={this.state.directMembers} ready={this.state.directMembers !== -1}
click={function(){ value={this.state.directMembers}
emitter.emit('query', "MATCH (n)-[r:MemberOf]->(m:Group {name:{name}}) RETURN n,r,m", {name: this.state.label}) click={function(){
}.bind(this)} /> emitter.emit('query', "MATCH (n)-[r:MemberOf]->(m:Group {name:{name}}) RETURN n,r,m", {name: this.state.label});
</dd> }.bind(this)}
<dt> />
Unrolled Members </dd>
</dt> <dt>
<dd> Unrolled Members
<NodeALink </dt>
ready={this.state.unrolledMembers !== -1} <dd>
value={this.state.unrolledMembers} <NodeALink
click={function(){ ready={this.state.unrolledMembers !== -1}
emitter.emit('query', "MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) RETURN p", {name: this.state.label}, value={this.state.unrolledMembers}
this.state.label) click={function(){
}.bind(this)} /> emitter.emit('query', "MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) RETURN p", {name: this.state.label},
</dd> this.state.label);
<dt> }.bind(this)}
Foreign Members />
</dt> </dd>
<dd> <dt>
<NodeALink Foreign Members
ready={this.state.foreignGroupMembers !== -1} </dt>
value={this.state.foreignGroupMembers} <dd>
click={function(){ <NodeALink
emitter.emit('query', "MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) WHERE NOT g.domain = n.domain RETURN p", {name: this.state.label}, ready={this.state.foreignGroupMembers !== -1}
this.state.label) value={this.state.foreignGroupMembers}
}.bind(this)} /> click={function(){
</dd> emitter.emit('query', "MATCH p = (n)-[r:MemberOf*1..]->(g:Group {name:{name}}) WHERE NOT g.domain = n.domain RETURN p", {name: this.state.label},
<br /> this.state.label);
<h4>Group Membership</h4> }.bind(this)}
<dt> />
First Degree Group Membership </dd>
</dt> <br />
<dd> <h4>Group Membership</h4>
<NodeALink <dt>
ready={this.state.firstDegreeGroupMembership !== -1} First Degree Group Membership
value={this.state.firstDegreeGroupMembership} </dt>
click={function(){ <dd>
emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r:MemberOf]->(g2:Group) RETURN p", {name: this.state.label}, <NodeALink
this.state.label) ready={this.state.firstDegreeGroupMembership !== -1}
}.bind(this)} /> value={this.state.firstDegreeGroupMembership}
</dd> click={function(){
<dt> emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r:MemberOf]->(g2:Group) RETURN p", {name: this.state.label},
Unrolled Member Of this.state.label);
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.unrolledMemberOf !== -1} <dt>
value={this.state.unrolledMemberOf} Unrolled Member Of
click={function(){ </dt>
emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r:MemberOf*1..]->(g2:Group) RETURN p", {name: this.state.label}, <dd>
this.state.label) <NodeALink
}.bind(this)} /> ready={this.state.unrolledMemberOf !== -1}
</dd> value={this.state.unrolledMemberOf}
<dt> click={function(){
Foreign Group Membership emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r:MemberOf*1..]->(g2:Group) RETURN p", {name: this.state.label},
</dt> this.state.label);
<dd> }.bind(this)}
<NodeALink />
ready={this.state.foreignGroupMembership !== -1} </dd>
value={this.state.foreignGroupMembership} <dt>
click={function(){ Foreign Group Membership
emitter.emit('query', "MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:Group {name:{name}}) MATCH (m)-[r:MemberOf]->(n) RETURN m,r,n", {name: this.state.label, domain: domain}) </dt>
}.bind(this)} /> <dd>
</dd> <NodeALink
<br /> ready={this.state.foreignGroupMembership !== -1}
<h4>Local Admin Rights</h4> value={this.state.foreignGroupMembership}
<dt> click={function(){
First Degree Local Admin emitter.emit('query', "MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:Group {name:{name}}) MATCH (m)-[r:MemberOf]->(n) RETURN m,r,n", {name: this.state.label, domain: domain});
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.directAdminTo !== -1} <br />
value={this.state.directAdminTo} <h4>Local Admin Rights</h4>
click={function(){ <dt>
emitter.emit('query', "MATCH p=(g:Group {name:{name}})-[r:AdminTo]->(c:Computer) RETURN p", {name: this.state.label}, First Degree Local Admin
this.state.label) </dt>
}.bind(this)} /> <dd>
</dd> <NodeALink
<dt> ready={this.state.directAdminTo !== -1}
Group Delegated Local Admin Rights value={this.state.directAdminTo}
</dt> click={function(){
<dd> emitter.emit('query', "MATCH p=(g:Group {name:{name}})-[r:AdminTo]->(c:Computer) RETURN p", {name: this.state.label},
<NodeALink this.state.label);
ready={this.state.groupDelegatedAdmin !== -1} }.bind(this)}
value={this.state.groupDelegatedAdmin} />
click={function(){ </dd>
emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AdminTo]->(c:Computer) RETURN p", {name: this.state.label}, <dt>
this.state.label) Group Delegated Local Admin Rights
}.bind(this)} /> </dt>
</dd> <dd>
<dt> <NodeALink
Derivative Local Admin Rights ready={this.state.groupDelegatedAdmin !== -1}
</dt> value={this.state.groupDelegatedAdmin}
<dd> click={function(){
<NodeALink emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AdminTo]->(c:Computer) RETURN p", {name: this.state.label},
ready={this.state.derivativeAdminTo !== -1} this.state.label);
value={this.state.derivativeAdminTo} }.bind(this)}
click={function(){ />
emitter.emit('query', "MATCH p = shortestPath((g:Group {name:{name}})-[r:MemberOf|AdminTo|HasSession*1..]->(c:Computer)) RETURN p", {name: this.state.label}, </dd>
this.state.label) <dt>
}.bind(this)} /> Derivative Local Admin Rights
</dd> </dt>
<br /> <dd>
<h4>Outbound Object Control</h4> <NodeALink
<dt> ready={this.state.derivativeAdminTo !== -1}
First Degree Object Control value={this.state.derivativeAdminTo}
</dt> click={function(){
<dd> emitter.emit('query', "MATCH (c:Computer) WHERE NOT c.name={name} WITH c MATCH p = shortestPath((g:Group {name:{name}})-[r:MemberOf|AdminTo|HasSession*1..]->(c)) RETURN p", {name: this.state.label},
<NodeALink this.state.label);
ready={this.state.firstdegreeControl !== -1} }.bind(this)}
value={this.state.firstdegreeControl} />
click={function(){ </dd>
emitter.emit('query', "MATCH p = (g:Group {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label}) <br />
}.bind(this)} /> <h4>Outbound Object Control</h4>
</dd> <dt>
<dt> First Degree Object Control
Group Delegated Object Control </dt>
</dt> <dd>
<dd> <NodeALink
<NodeALink ready={this.state.firstdegreeControl !== -1}
ready={this.state.groupDelegatedControl !== -1} value={this.state.firstdegreeControl}
value={this.state.groupDelegatedControl} click={function(){
click={function(){ emitter.emit('query', "MATCH p = (g:Group {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label});
emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label} }.bind(this)}
,this.state.label) />
}.bind(this)} /> </dd>
</dd> <dt>
<dt> Group Delegated Object Control
Transitive Object Control </dt>
</dt> <dd>
<dd> <NodeALink
<NodeALink ready={this.state.groupDelegatedControl !== -1}
ready={this.state.transitiveControl !== -1} value={this.state.groupDelegatedControl}
value={this.state.transitiveControl} click={function(){
click={function(){ emitter.emit('query', "MATCH p = (g1:Group {name:{name}})-[r1:MemberOf*1..]->(g2:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label}
emitter.emit('query', "MATCH p = shortestPath((g:Group {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN p", {name:this.state.label} ,this.state.label);
,this.state.label) }.bind(this)}
}.bind(this)} /> />
</dd> </dd>
<br /> <dt>
<h4>Inbound Object Control</h4> Transitive Object Control
<dt> </dt>
Explicit Object Controllers <dd>
</dt> <NodeALink
<dd> ready={this.state.transitiveControl !== -1}
<NodeALink value={this.state.transitiveControl}
ready={this.state.firstDegreeControllers !== -1} click={function(){
value={this.state.firstDegreeControllers} emitter.emit('query', "MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((g:Group {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN p", {name:this.state.label}
click={function(){ ,this.state.label);
emitter.emit('query', "MATCH p = (n)-[r:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g:Group {name: {name}}) RETURN p", {name:this.state.label} }.bind(this)}
,this.state.label) />
}.bind(this)} /> </dd>
</dd> <br />
<dt> <h4>Inbound Object Control</h4>
Unrolled Object Controllers <dt>
</dt> Explicit Object Controllers
<dd> </dt>
<NodeALink <dd>
ready={this.state.unrolledControllers !== -1} <NodeALink
value={this.state.unrolledControllers} ready={this.state.firstDegreeControllers !== -1}
click={function(){ value={this.state.firstDegreeControllers}
emitter.emit('query', "MATCH p = (n1)-[r:MemberOf*1..]->(g1:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g2:Group {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = g2.name) AND NOT n1.name = g2.name RETURN p", {name:this.state.label} click={function(){
,this.state.label) emitter.emit('query', "MATCH p = (n)-[r:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g:Group {name: {name}}) RETURN p", {name:this.state.label}
}.bind(this)} /> ,this.state.label);
</dd> }.bind(this)}
<dt> />
Transitive Object Controllers </dd>
</dt> <dt>
<dd> Unrolled Object Controllers
<NodeALink </dt>
ready={this.state.transitiveControllers !== -1} <dd>
value={this.state.transitiveControllers} <NodeALink
click={function(){ ready={this.state.unrolledControllers !== -1}
emitter.emit('query', "MATCH p = shortestPath((n)-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(g:Group {name: {name}})) RETURN p", {name:this.state.label} value={this.state.unrolledControllers}
,this.state.label) click={function(){
}.bind(this)} /> emitter.emit('query', "MATCH p = (n1)-[r:MemberOf*1..]->(g1:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(g2:Group {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = g2.name) AND NOT n1.name = g2.name RETURN p", {name:this.state.label}
</dd> ,this.state.label);
</dl> }.bind(this)}
</div> />
); </dd>
} <dt>
Transitive Object Controllers
</dt>
<dd>
<NodeALink
ready={this.state.transitiveControllers !== -1}
value={this.state.transitiveControllers}
click={function(){
emitter.emit('query', "MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((n)-[r:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(g:Group {name: {name}})) RETURN p", {name:this.state.label}
,this.state.label);
}.bind(this)}
/>
</dd>
</dl>
</div>
);
}
} }
GroupNodeData.propTypes = { GroupNodeData.propTypes = {
visible : React.PropTypes.bool.isRequired visible : React.PropTypes.bool.isRequired
} };

View File

@ -1,363 +1,376 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import NodeALink from './NodeALink' import NodeALink from './NodeALink';
import PropTypes from 'prop-types' import PropTypes from 'prop-types';
export default class UserNodeData extends Component { export default class UserNodeData extends Component {
constructor(){ constructor(){
super(); super();
this.state = { this.state = {
label: "", label: "",
samAccountName: "None", samAccountName: "None",
displayName: "None", displayName: "None",
pwdLastChanged: "None", pwdLastChanged: "None",
firstDegreeGroupMembership: -1, firstDegreeGroupMembership: -1,
unrolledGroupMembership: -1, unrolledGroupMembership: -1,
foreignGroupMembership: -1, foreignGroupMembership: -1,
firstDegreeLocalAdmin: -1, firstDegreeLocalAdmin: -1,
groupDelegatedLocalAdmin: -1, groupDelegatedLocalAdmin: -1,
derivativeLocalAdmin: -1, derivativeLocalAdmin: -1,
sessions: -1, sessions: -1,
firstdegreeControllers: -1, firstdegreeControllers: -1,
unrolledControllers: -1, unrolledControllers: -1,
transitiveControllers: -1, transitiveControllers: -1,
firstdegreeControl: -1, firstdegreeControl: -1,
unrolledControl: -1, unrolledControl: -1,
transitiveControl: -1, transitiveControl: -1,
driversessions : [] driversessions : []
} };
emitter.on('userNodeClicked', this.getNodeData.bind(this)); emitter.on('userNodeClicked', this.getNodeData.bind(this));
} }
getNodeData(payload){ getNodeData(payload){
$.each(this.state.driversessions,function(index, record){ $.each(this.state.driversessions,function(index, record){
record.close(); record.close();
}) });
this.setState({ this.setState({
label: payload, label: payload,
samAccountName: "None", samAccountName: "None",
displayName: "None", displayName: "None",
pwdLastChanged: "None", pwdLastChanged: "None",
firstDegreeGroupMembership: -1, firstDegreeGroupMembership: -1,
unrolledGroupMembership: -1, unrolledGroupMembership: -1,
foreignGroupMembership: -1, foreignGroupMembership: -1,
firstDegreeLocalAdmin: -1, firstDegreeLocalAdmin: -1,
groupDelegatedLocalAdmin: -1, groupDelegatedLocalAdmin: -1,
derivativeLocalAdmin: -1, derivativeLocalAdmin: -1,
sessions: -1, sessions: -1,
firstdegreeControllers: -1, firstdegreeControllers: -1,
unrolledControllers: -1, unrolledControllers: -1,
transitiveControllers: -1, transitiveControllers: -1,
firstdegreeControl: -1, firstdegreeControl: -1,
unrolledControl: -1, unrolledControl: -1,
transitiveControl: -1 transitiveControl: -1
}) });
var domain = '@' + payload.split('@').last() var domain = '@' + payload.split('@').last();
var s1 = driver.session() var s1 = driver.session();
var s2 = driver.session() var s2 = driver.session();
var s3 = driver.session() var s3 = driver.session();
var s4 = driver.session() var s4 = driver.session();
var s5 = driver.session() var s5 = driver.session();
var s6 = driver.session() var s6 = driver.session();
var s7 = driver.session() var s7 = driver.session();
var s8 = driver.session() var s8 = driver.session();
var s9 = driver.session() var s9 = driver.session();
var s10 = driver.session() var s10 = driver.session();
var s11 = driver.session() var s11 = driver.session();
var s12 = driver.session() var s12 = driver.session();
var s13 = driver.session() var s13 = driver.session();
s1.run("MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:User {name:{name}}) MATCH (m)-[r:MemberOf*1..]->(n) RETURN count(n)", {name:payload, domain: domain}) s1.run("MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:User {name:{name}}) MATCH (m)-[r:MemberOf*1..]->(n) RETURN count(n)", {name:payload, domain: domain})
.then(function(result){ .then(function(result){
this.setState({'foreignGroupMembership':result.records[0]._fields[0].low}) this.setState({'foreignGroupMembership':result.records[0]._fields[0].low});
s1.close() s1.close();
}.bind(this)) }.bind(this));
s2.run("MATCH (n:User {name:{name}}), (m:Group), p=(n)-[:MemberOf]->(m) RETURN count(m)", {name:payload}) s2.run("MATCH (n:User {name:{name}}), (m:Group), p=(n)-[:MemberOf]->(m) RETURN count(m)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeGroupMembership':result.records[0]._fields[0].low}) this.setState({'firstDegreeGroupMembership':result.records[0]._fields[0].low});
s2.close() s2.close();
}.bind(this)) }.bind(this));
s3.run("MATCH p = (n:User {name:{name}})-[r:MemberOf*1..]->(g:Group) RETURN COUNT(DISTINCT(g))", {name:payload}) s3.run("MATCH p = (n:User {name:{name}})-[r:MemberOf*1..]->(g:Group) RETURN COUNT(DISTINCT(g))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledGroupMembership':result.records[0]._fields[0].low}) this.setState({'unrolledGroupMembership':result.records[0]._fields[0].low});
s3.close() s3.close();
}.bind(this)) }.bind(this));
s4.run("MATCH p = (n:User {name:{name}})-[r:AdminTo]->(c:Computer) RETURN COUNT(DISTINCT(c))", {name:payload}) s4.run("MATCH p = (n:User {name:{name}})-[r:AdminTo]->(c:Computer) RETURN COUNT(DISTINCT(c))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstDegreeLocalAdmin':result.records[0]._fields[0].low}) this.setState({'firstDegreeLocalAdmin':result.records[0]._fields[0].low});
s4.close() s4.close();
}.bind(this)) }.bind(this));
s5.run("MATCH p=(n:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c:Computer) RETURN count(distinct(c))", {name:payload}) s5.run("MATCH p=(n:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c:Computer) RETURN count(distinct(c))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'groupDelegatedLocalAdmin':result.records[0]._fields[0].low}) this.setState({'groupDelegatedLocalAdmin':result.records[0]._fields[0].low});
s5.close() s5.close();
}.bind(this)) }.bind(this));
s6.run("MATCH p = shortestPath((n:User {name:{name}})-[r:HasSession|AdminTo|MemberOf*1..]->(c:Computer)) RETURN COUNT(c)", {name:payload}) s6.run("MATCH (c:Computer) WHERE NOT c.name={name} WITH c MATCH p = shortestPath((n:User {name:{name}})-[r:HasSession|AdminTo|MemberOf*1..]->(c)) RETURN COUNT(c)", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'derivativeLocalAdmin':result.records[0]._fields[0].low}) this.setState({'derivativeLocalAdmin':result.records[0]._fields[0].low});
s6.close() s6.close();
}.bind(this)) }.bind(this));
s7.run("MATCH p = (n:Computer)-[r:HasSession]->(m:User {name:{name}}) RETURN COUNT(DISTINCT(n))", {name:payload}) s7.run("MATCH p = (n:Computer)-[r:HasSession]->(m:User {name:{name}}) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'sessions':result.records[0]._fields[0].low}) this.setState({'sessions':result.records[0]._fields[0].low});
s7.close() s7.close();
}.bind(this)) }.bind(this));
s8.run("MATCH p = (n)-[r:AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u1:User {name: {name}}) RETURN COUNT(DISTINCT(n))", {name:payload}) s8.run("MATCH p = (n)-[r:AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u1:User {name: {name}}) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstdegreeControllers':result.records[0]._fields[0].low}) this.setState({'firstdegreeControllers':result.records[0]._fields[0].low});
s8.close() s8.close();
}.bind(this)) }.bind(this));
s9.run("MATCH p = (n1)-[r:MemberOf*1..]->(g:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u:User {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = u.name) AND NOT n1.name = u.name RETURN COUNT(DISTINCT(n1))", {name:payload}) s9.run("MATCH p = (n1)-[r:MemberOf*1..]->(g:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u:User {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = u.name) AND NOT n1.name = u.name RETURN COUNT(DISTINCT(n1))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledControllers':result.records[0]._fields[0].low}) this.setState({'unrolledControllers':result.records[0]._fields[0].low});
s9.close() s9.close();
}.bind(this)) }.bind(this));
s10.run("MATCH p = shortestPath((n1)-[r1:MemberOf|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(u1:User {name: {name}})) RETURN COUNT(DISTINCT(n1))", {name:payload}) s10.run("MATCH (n1) WHERE NOT n1.name={name} WITH n1 MATCH p = shortestPath((n1)-[r1:MemberOf|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(u1:User {name: {name}})) RETURN COUNT(DISTINCT(n1))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'transitiveControllers':result.records[0]._fields[0].low}) this.setState({'transitiveControllers':result.records[0]._fields[0].low});
s10.close() s10.close();
}.bind(this)) }.bind(this));
s11.run("MATCH p = (u:User {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload}) s11.run("MATCH p = (u:User {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'firstdegreeControl':result.records[0]._fields[0].low}) this.setState({'firstdegreeControl':result.records[0]._fields[0].low});
s11.close() s11.close();
}.bind(this)) }.bind(this));
s12.run("MATCH p = (u:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload}) s12.run("MATCH p = (u:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'unrolledControl':result.records[0]._fields[0].low}) this.setState({'unrolledControl':result.records[0]._fields[0].low});
s12.close() s12.close();
}.bind(this)) }.bind(this));
s13.run("MATCH p = shortestPath((u:User {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN COUNT(DISTINCT(n))", {name:payload}) s13.run("MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((u:User {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN COUNT(DISTINCT(n))", {name:payload})
.then(function(result){ .then(function(result){
this.setState({'transitiveControl':result.records[0]._fields[0].low}) this.setState({'transitiveControl':result.records[0]._fields[0].low});
s13.close() s13.close();
}.bind(this)) }.bind(this));
this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13]}) this.setState({'driversessions': [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13]});
} }
render() { render() {
var domain = '@' + this.state.label.split('@').last() var domain = '@' + this.state.label.split('@').last();
return ( return (
<div className={this.props.visible ? "" : "displaynone"}> <div className={this.props.visible ? "" : "displaynone"}>
<dl className='dl-horizontal'> <dl className='dl-horizontal'>
<h4> <h4>
Node Info Node Info
</h4> </h4>
<dt> <dt>
Name Name
</dt> </dt>
<dd> <dd>
{this.state.label} {this.state.label}
</dd> </dd>
<dt> <dt>
SAMAccountName SAMAccountName
</dt> </dt>
<dd> <dd>
{this.state.samAccountName} {this.state.samAccountName}
</dd> </dd>
<dt> <dt>
Display Name Display Name
</dt> </dt>
<dd> <dd>
{this.state.displayName} {this.state.displayName}
</dd> </dd>
<dt> <dt>
Password Last Changed Password Last Changed
</dt> </dt>
<dd> <dd>
{this.state.pwdLastChanged} {this.state.pwdLastChanged}
</dd> </dd>
<dt> <dt>
Sessions Sessions
</dt> </dt>
<dd> <dd>
<NodeALink <NodeALink
ready={this.state.sessions !== -1} ready={this.state.sessions !== -1}
value={this.state.sessions} value={this.state.sessions}
click={function(){ click={function(){
emitter.emit('query', "MATCH (n:Computer)-[r:HasSession]->(m:User {name:{name}}) RETURN n,r,m", {name:this.state.label} emitter.emit('query', "MATCH (n:Computer)-[r:HasSession]->(m:User {name:{name}}) RETURN n,r,m", {name:this.state.label}
,this.state.label) ,this.state.label);
}.bind(this)} /> }.bind(this)}
</dd> />
<br /> </dd>
<h4>Group Membership</h4> <br />
<dt> <h4>Group Membership</h4>
First Degree Group Memberships <dt>
</dt> First Degree Group Memberships
<dd> </dt>
<NodeALink <dd>
ready={this.state.firstDegreeGroupMembership !== -1} <NodeALink
value={this.state.firstDegreeGroupMembership} ready={this.state.firstDegreeGroupMembership !== -1}
click={function(){ value={this.state.firstDegreeGroupMembership}
emitter.emit( click={function(){
'query', emitter.emit(
"MATCH p = (n:User {name:{name}})-[r:MemberOf]->(g:Group) RETURN p", {name:this.state.label} 'query',
) "MATCH p = (n:User {name:{name}})-[r:MemberOf]->(g:Group) RETURN p", {name:this.state.label}
}.bind(this)} /> );
</dd> }.bind(this)}
<dt> />
Unrolled Group Memberships </dd>
</dt> <dt>
<dd> Unrolled Group Memberships
<NodeALink </dt>
ready={this.state.unrolledGroupMembership !== -1} <dd>
value={this.state.unrolledGroupMembership} <NodeALink
click={function(){ ready={this.state.unrolledGroupMembership !== -1}
emitter.emit('query', "MATCH p = (n:User {name:{name}})-[r:MemberOf*1..]->(g:Group) RETURN p", {name:this.state.label}, value={this.state.unrolledGroupMembership}
this.state.label) click={function(){
}.bind(this)} /> emitter.emit('query', "MATCH p = (n:User {name:{name}})-[r:MemberOf*1..]->(g:Group) RETURN p", {name:this.state.label},
</dd> this.state.label);
<dt> }.bind(this)}
Foreign Group Membership />
</dt> </dd>
<dd> <dt>
<NodeALink Foreign Group Membership
ready={this.state.foreignGroupMembership !== -1} </dt>
value={this.state.foreignGroupMembership} <dd>
click={function(){ <NodeALink
emitter.emit('query', ready={this.state.foreignGroupMembership !== -1}
"MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:User {name:{name}}) WITH n,m MATCH p = (m)-[r:MemberOf*1..]->(n) RETURN p", {name: this.state.label, domain: domain}) value={this.state.foreignGroupMembership}
}.bind(this)} /> click={function(){
</dd> emitter.emit('query',
<br /> "MATCH (n:Group) WHERE NOT n.name ENDS WITH {domain} WITH n MATCH (m:User {name:{name}}) WITH n,m MATCH p = (m)-[r:MemberOf*1..]->(n) RETURN p", {name: this.state.label, domain: domain});
<h4> }.bind(this)}
Local Admin Rights />
</h4> </dd>
<dt> <br />
First Degree Local Admin <h4>
</dt> Local Admin Rights
<dd> </h4>
<NodeALink <dt>
ready={this.state.firstDegreeLocalAdmin !== -1} First Degree Local Admin
value={this.state.firstDegreeLocalAdmin} </dt>
click={function(){ <dd>
emitter.emit('query', "MATCH p = (n:User {name:{name}})-[r:AdminTo]->(c:Computer) RETURN p", {name:this.state.label}) <NodeALink
}.bind(this)} /> ready={this.state.firstDegreeLocalAdmin !== -1}
</dd> value={this.state.firstDegreeLocalAdmin}
<dt> click={function(){
Group Delegated Local Admin Rights emitter.emit('query', "MATCH p = (n:User {name:{name}})-[r:AdminTo]->(c:Computer) RETURN p", {name:this.state.label});
</dt> }.bind(this)}
<dd> />
<NodeALink </dd>
ready={this.state.groupDelegatedLocalAdmin !== -1} <dt>
value={this.state.groupDelegatedLocalAdmin} Group Delegated Local Admin Rights
click={function(){ </dt>
emitter.emit('query', "MATCH p=(n:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c:Computer) RETURN p", {name:this.state.label} <dd>
,this.state.label) <NodeALink
}.bind(this)} /> ready={this.state.groupDelegatedLocalAdmin !== -1}
</dd> value={this.state.groupDelegatedLocalAdmin}
<dt> click={function(){
Derivative Local Admin Rights emitter.emit('query', "MATCH p=(n:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AdminTo]->(c:Computer) RETURN p", {name:this.state.label}
</dt> ,this.state.label);
<dd> }.bind(this)}
<NodeALink />
ready={this.state.derivativeLocalAdmin !== -1} </dd>
value={this.state.derivativeLocalAdmin} <dt>
click={function(){ Derivative Local Admin Rights
emitter.emit('query', "MATCH p = shortestPath((n:User {name:{name}})-[r:HasSession|AdminTo|MemberOf*1..]->(c:Computer)) RETURN p", {name:this.state.label} </dt>
,this.state.label) <dd>
}.bind(this)} /> <NodeALink
</dd> ready={this.state.derivativeLocalAdmin !== -1}
<br /> value={this.state.derivativeLocalAdmin}
<h4> click={function(){
Outbound Object Control emitter.emit('query', "MATCH (c:Computer) WHERE NOT c.name={name} WITH c MATCH p = shortestPath((n:User {name:{name}})-[r:HasSession|AdminTo|MemberOf*1..]->(c)) RETURN p", {name:this.state.label}
</h4> ,this.state.label);
<dt> }.bind(this)}
First Degree Object Control />
</dt> </dd>
<dd> <br />
<NodeALink <h4>
ready={this.state.firstdegreeControl !== -1} Outbound Object Control
value={this.state.firstdegreeControl} </h4>
click={function(){ <dt>
emitter.emit('query', "MATCH p = (u:User {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label}) First Degree Object Control
}.bind(this)} /> </dt>
</dd> <dd>
<dt> <NodeALink
Group Delegated Object Control ready={this.state.firstdegreeControl !== -1}
</dt> value={this.state.firstdegreeControl}
<dd> click={function(){
<NodeALink emitter.emit('query', "MATCH p = (u:User {name:{name}})-[r1:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label});
ready={this.state.unrolledControl !== -1} }.bind(this)}
value={this.state.unrolledControl} />
click={function(){ </dd>
emitter.emit('query', "MATCH p = (u:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label} <dt>
,this.state.label) Group Delegated Object Control
}.bind(this)} /> </dt>
</dd> <dd>
<dt> <NodeALink
Transitive Object Control ready={this.state.unrolledControl !== -1}
</dt> value={this.state.unrolledControl}
<dd> click={function(){
<NodeALink emitter.emit('query', "MATCH p = (u:User {name:{name}})-[r1:MemberOf*1..]->(g:Group)-[r2:AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(n) RETURN p", {name:this.state.label}
ready={this.state.transitiveControl !== -1} ,this.state.label);
value={this.state.transitiveControl} }.bind(this)}
click={function(){ />
emitter.emit('query', "MATCH p = shortestPath((u:User {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN p", {name:this.state.label} </dd>
,this.state.label) <dt>
}.bind(this)} /> Transitive Object Control
</dd> </dt>
<br /> <dd>
<h4>Inbound Object Control</h4> <NodeALink
<dt> ready={this.state.transitiveControl !== -1}
Explicit Object Controllers value={this.state.transitiveControl}
</dt> click={function(){
<dd> emitter.emit('query', "MATCH (n) WHERE NOT n.name={name} WITH n MATCH p = shortestPath((u:User {name:{name}})-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(n)) RETURN p", {name:this.state.label}
<NodeALink ,this.state.label);
ready={this.state.firstdegreeControllers !== -1} }.bind(this)}
value={this.state.firstdegreeControllers} />
click={function(){ </dd>
emitter.emit('query', "MATCH p = (n)-[r:AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u1:User {name: {name}}) RETURN p", {name:this.state.label} <br />
,this.state.label) <h4>Inbound Object Control</h4>
}.bind(this)} /> <dt>
</dd> Explicit Object Controllers
<dt> </dt>
Unrolled Object Controllers <dd>
</dt> <NodeALink
<dd> ready={this.state.firstdegreeControllers !== -1}
<NodeALink value={this.state.firstdegreeControllers}
ready={this.state.unrolledControllers !== -1} click={function(){
value={this.state.unrolledControllers} emitter.emit('query', "MATCH p = (n)-[r:AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u1:User {name: {name}}) RETURN p", {name:this.state.label}
click={function(){ ,this.state.label);
emitter.emit('query', "MATCH p = (n1)-[r:MemberOf*1..]->(g:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u:User {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = u.name) AND NOT n1.name = u.name RETURN p", {name:this.state.label} }.bind(this)}
,this.state.label) />
}.bind(this)} /> </dd>
</dd> <dt>
<dt> Unrolled Object Controllers
Transitive Object Controllers </dt>
</dt> <dd>
<dd> <NodeALink
<NodeALink ready={this.state.unrolledControllers !== -1}
ready={this.state.transitiveControllers !== -1} value={this.state.unrolledControllers}
value={this.state.transitiveControllers} click={function(){
click={function(){ emitter.emit('query', "MATCH p = (n1)-[r:MemberOf*1..]->(g:Group)-[r1:AddMembers|AllExtendedRights|GenericAll|GenericWrite|WriteDacl|WriteOwner]->(u:User {name: {name}}) WITH LENGTH(p) as pathLength, p, n1 WHERE NONE (x in NODES(p)[1..(pathLength-1)] WHERE x.name = u.name) AND NOT n1.name = u.name RETURN p", {name:this.state.label}
emitter.emit('query', "MATCH p = shortestPath((n1)-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(u1:User {name: {name}})) RETURN p", {name:this.state.label} ,this.state.label);
,this.state.label) }.bind(this)}
}.bind(this)} /> />
</dd> </dd>
</dl> <dt>
</div> Transitive Object Controllers
); </dt>
} <dd>
<NodeALink
ready={this.state.transitiveControllers !== -1}
value={this.state.transitiveControllers}
click={function(){
emitter.emit('query', "MATCH (n1) WHERE NOT n1.name={name} WITH n1 MATCH p = shortestPath((n1)-[r1:MemberOf|AddMembers|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(u1:User {name: {name}})) RETURN p", {name:this.state.label}
,this.state.label);
}.bind(this)}
/>
</dd>
</dl>
</div>
);
}
} }
UserNodeData.propTypes = { UserNodeData.propTypes = {
visible : React.PropTypes.bool.isRequired visible : React.PropTypes.bool.isRequired
} };