Skip to content

Commit

Permalink
Updated documentation for multiple auth rules files
Browse files Browse the repository at this point in the history
  • Loading branch information
stffn committed Dec 27, 2009
1 parent ec9d6d4 commit 6d72c49
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
* Allow multiple authorization rules files [kaichen]

** RELEASE 0.4 (November 15, 2009) **

* Implemented controller namespace handling [sb]
Expand Down
3 changes: 2 additions & 1 deletion README.rdoc
Expand Up @@ -241,7 +241,8 @@ the conditions for manual rewrites.

== Authorization Rules

Authorization rules are defined in config/authorization_rules.rb(Or redefine rules files path via +AUTH_RULE_FILES+). E.g.
Authorization rules are defined in config/authorization_rules.rb
(Or redefine rules files path via +Authorization::AUTH_RULE_FILES+). E.g.

authorization do
role :admin do
Expand Down
2 changes: 1 addition & 1 deletion lib/declarative_authorization/authorization.rb
Expand Up @@ -62,7 +62,7 @@ class Engine
:rev_role_hierarchy

# If +reader+ is not given, a new one is created with the default
# authorization configuration of +AUTH_DSL_FILE+. If given, may be either
# authorization configuration of +AUTH_DSL_FILES+. If given, may be either
# a Reader object or a path to a configuration file.
def initialize (reader = nil)
if reader.nil?
Expand Down
1 change: 1 addition & 0 deletions lib/declarative_authorization/reader.rb
Expand Up @@ -69,6 +69,7 @@ def parse (dsl_data, file_name = nil)
def self.load (dsl_files)
# TODO cache reader in production mode?
reader = new
dsl_files = [dsl_files].flatten
dsl_files.each do |file|
reader.parse(File.read(file), file) if File.exist?(file)
end
Expand Down

0 comments on commit 6d72c49

Please sign in to comment.