Sha256: 3eaf433db88f95b93292684cbeb0bbb54447bdf208bed2868d7da455c721e658

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

class User
  include DataMapper::Resource

  property :id,     Serial
  property :name,   String
  
  has n, :keys
  has n, :groups
  has n, :grants
  
  belongs_to :map, :required => false
  
  def authorized_keys_file  
    authorized_keys = self.keys.collect(&:public_key).join
        
    raise "User #{self.name} has a blank SSH key - this is not permitted" if authorized_keys.blank?
    authorized_keys  
  end
  
  def authorized_keys_file_path
    "/home/#{self.name}/.ssh/authorized_keys"
  end
  
  def home_directory_path
    "/home/#{self.name}/"
  end
  
  def ssh_config_directory_path
    "/home/#{self.name}/.ssh/"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fabric-0.4.4 lib/fabric/user.rb