 
 announceSetChange = ->
   apiClient.type('subject_sets').emit 'add-or-remove'
+
+isAdmin = ->
+  console.log(localStorage.getItem('adminFlag') || false)
+  localStorage.getItem('adminFlag') || false
 
 SubjectSetListingRow = React.createClass
   displayName: 'SubjectSetListingRow'

      <hr />

      <p>
        <UploadDropTarget accept="text/csv, text/tab-separated-values, image/*" multiple onSelect={@handleFileSelection}>
          <strong>Drag-and-drop or click to upload manifests and subject images here.</strong><br />
          Manifests must be <code>.csv</code> or <code>.tsv</code>. The first row should define metadata headers. All other rows should include at least one reference to an image filename in the same directory as the manifest.<br />
          Headers that begin with "#" or "//" denote private fields that will not be visible to classifiers.<br />

        subjects.push {locations, metadata}

    @state.manifests[fileName] = {errors, subjects}
    console.log(@state.manifests)
    @forceUpdate()

  _findFilesInMetadata: (metadata) ->
    filesInMetadata = []
    for key, value of metadata
      extensions = if isAdmin() then '' else "(?:#{VALID_SUBJECT_EXTENSIONS.join '|'})"
      filesInValue = value.match? ///([^#{INVALID_FILENAME_CHARS.join ''}]+#{extensions})///gi
      if filesInValue?
        filesInMetadata.push filesInValue...
    filesInMetadata
