 
       # Don't allow users to modify the user docs
       Meteor.users.deny({update: () -> true })
+
+      # Only allow job owners to manage or rerun jobs
+      myJobs.allow
+         manager: (userId, method, params) ->
+            ids = params[0]
+            unless typeof ids is 'object' and ids instanceof Array
+               ids = [ ids ]
+            numIds = ids.length
+            numMatches = myJobs.find({ _id: { $in: ids }, 'data.owner': userId }).count()
+            return numMatches is numIds
+
+         jobRerun: (userId, method, params) ->
+            id = params[0]
+            numMatches = myJobs.find({ _id: id, 'data.owner': userId }).count()
+            return numMatches is 1
 
       # Allow rules for security. Without these, no writes would be allowed by default
       myData.allow

         percent = Session.get "#{this._id}"

      isImage: () ->
         types =
            'image/jpeg': true
            'image/png': true
            'image/gif': true
            'image/tiff': true
         types[this.contentType]?

   fileTableEvents =
      # Wire up the event to remove a file by clicking the `X`

               contentType: 'image/png'
               metadata: file.metadata
            job = myJobs.createJob('makeThumb',
               owner: file.metadata._auth.owner
               inputFileURL: Meteor.absoluteUrl("#{myData.baseURL[1..]}/#{file._id}")
               outputFileURL: Meteor.absoluteUrl("#{myData.baseURL[1..]}/put/#{outputFileId}")
               inputFileId: file._id
