apache-config-generator/lib/apache/permissions.rb

39 lines
631 B
Ruby
Raw Normal View History

2010-04-27 21:00:43 +00:00
module Apache
module Permissions
def deny_from_all
2010-04-28 20:19:03 +00:00
order :deny, :allow
deny :from_all
2010-04-27 21:00:43 +00:00
end
def allow_from_all
2010-04-28 20:19:03 +00:00
order :allow, :deny
allow :from_all
2010-04-27 21:00:43 +00:00
end
2010-05-05 14:44:20 +00:00
2010-05-05 16:25:07 +00:00
def allow_from(where)
allow "from_#{where}".to_sym
end
2010-05-05 14:44:20 +00:00
def order(*args)
self << "Order #{args * ','}"
end
def default_restrictive!
directory '/' do
options :follow_sym_links
allow_override :none
deny_from_all
end
end
def no_htfiles!
files_match '^\.ht' do
deny_from_all
satisfy :all
end
end
alias :order! :order
2010-04-27 21:00:43 +00:00
end
end