Sha256: b83708dfd549be02dac8a2669ed01a615870287c944452629c932f37050684ce

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

/** @jsx React.DOM */

var Layer = React.createClass({
  render: function() {
    function abstractRole(expected) {
      return function(role) {
        var tokens = role.split(':');
        var kind = tokens[1];
        var abstractKinds = [ '@', 'layer' ];
        var isAbstract = abstractKinds.indexOf(kind) !== -1;
        return isAbstract === expected;
      }
    }
    
    var layer = this.props.data.layer;
    
    
    var hosts = layer.hosts.map(function (host) {
      return <li>
        <HostLink data={host} />
      </li>
    }.bind(this));
    var admins = this.props.data.admins.filter(abstractRole(false)).map(function (role) {
      return <RoleLink id={role}/>;
    }.bind(this));
    var users = this.props.data.users.filter(abstractRole(false)).map(function (role) {
      return <RoleLink id={role}/>
    }.bind(this));
    
    return (
      <div className="group">
        <h2>Layer {layer.id}</h2>
        
        <dl>
          <dt>Owner</dt>
          <dd><RoleLink id={layer.ownerid}/></dd>
          <dt>Admins</dt>
          <dd>
            <ul>
              {admins}
            </ul>
          </dd>
          <dt>Users</dt>
          <dd>
            <ul>
              {users}
            </ul>
          </dd>
          <dt>Hosts</dt>
          <dd>
            <ul>
              {hosts}
            </ul>
          </dd>
        </dl>
        <Permissions role={layer.roleid}/>
        <div className="audit auditLayer">
          <AuditBox roles={[layer.roleid]} resources={[layer.resource_identifier]}/>
        </div>
      </div>
    );
  }
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
conjur-asset-ui-api-1.1.1 public/js/views/layer.js
conjur-asset-ui-api-1.1.0 public/js/views/layer.js