Skip to content

Commit

Permalink
Prepare demo app to work with Change Supporter
Browse files Browse the repository at this point in the history
  • Loading branch information
stffn committed Jun 14, 2009
1 parent d014983 commit dfdb833
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/models/user.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -49,12 +49,19 @@ def self.authenticate(login, password)
# The necessary method for the plugin to find out about the role symbols # The necessary method for the plugin to find out about the role symbols
# Roles returns e.g. [:admin] # Roles returns e.g. [:admin]
def role_symbols def role_symbols
r = (roles || []).map {|r| r.to_sym} @role_symbols ||= (roles || []).map {|r| r.to_sym}
end end
# End of declarative_authorization code # End of declarative_authorization code




# Application-specific code # Application-specific code
has_many :talk_attendees has_many :talk_attendees
has_many :conference_attendees has_many :conference_attendees

# for ChangeAnalyzer: ensure that role_symbols is cloned
def clone
a_clone = super
a_clone.send(:instance_variable_set, :@role_symbols, @role_symbols.clone) if @role_symbols
a_clone
end
end end
2 changes: 1 addition & 1 deletion vendor/plugins/declarative_authorization
Submodule declarative_authorization updated 33 files
+12 −4 CHANGELOG
+13 −9 README.rdoc
+139 −14 app/controllers/authorization_rules_controller.rb
+2 −0 app/controllers/authorization_usages_controller.rb
+96 −13 app/helpers/authorization_rules_helper.rb
+49 −0 app/views/authorization_rules/_change.erb
+37 −0 app/views/authorization_rules/_show_graph.erb
+9 −0 app/views/authorization_rules/_suggestion.erb
+24 −0 app/views/authorization_rules/_suggestions.erb
+124 −0 app/views/authorization_rules/change.html.erb
+23 −4 app/views/authorization_rules/graph.dot.erb
+3 −2 app/views/authorization_rules/graph.html.erb
+3 −2 app/views/authorization_rules/index.html.erb
+2 −11 app/views/authorization_usages/index.html.erb
+2 −1 config/routes.rb
+1 −1 declarative_authorization.gemspec
+1 −1 declarative_authorization.gemspec.src
+87 −35 lib/declarative_authorization/authorization.rb
+0 −138 lib/declarative_authorization/authorization_rules_analyzer.rb
+252 −0 lib/declarative_authorization/development_support/analyzer.rb
+253 −0 lib/declarative_authorization/development_support/change_analyzer.rb
+578 −0 lib/declarative_authorization/development_support/change_supporter.rb
+243 −0 lib/declarative_authorization/development_support/development_support.rb
+26 −5 lib/declarative_authorization/in_controller.rb
+27 −2 lib/declarative_authorization/in_model.rb
+14 −0 lib/declarative_authorization/maintenance.rb
+10 −2 lib/declarative_authorization/reader.rb
+0 −123 test/authorization_rules_analyzer_test.rb
+44 −0 test/authorization_test.rb
+280 −0 test/development_support/analyzer_test.rb
+225 −0 test/development_support/change_analyzer_test.rb
+597 −0 test/development_support/change_supporter_test.rb
+5 −1 test/test_helper.rb

0 comments on commit dfdb833

Please sign in to comment.