Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Kozlov committed Nov 5, 2010
1 parent a972782 commit 3e46802
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
4 changes: 0 additions & 4 deletions Gemfile

This file was deleted.

17 changes: 9 additions & 8 deletions app/models/netzke_component_state.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# An emplementation of a component state manager with support for world/role/user-level masquerading.
#
# == Assumptions
#
# * Before calling anything else, the "init" class method gets called.
# The hash must be passed with the following keys:
# An emplementation of a state manager with a support for world/role/user-level masquerading.
# You can simply replace it with your own (e.g. you may not like ActiveRecord, or have different needs for masquerading),
# as long as it implements the following class-methods:
# * +init+ - gets called before anything else, and accepts a hash with the following keys:
# * +component+ should be set to component's persistence key (e.g. Netzke::Base#global_id)
# * +current_user+ should be set to the current user object
# * +session+ should be set to the controller's session
# * +state+ - returns the persistent state (a hash) for the component specified with the +init+ call
# * +update_state+ - accepts a hash, that should get merged with the current +state+
#
# == Assumptions
# This particular implementation assumes the following:
# * ActiveRecord as ORM
# * Current user belong_to Role
#
# * User#id is user's primary key
#
# * session[:masquerade_as] is a hash:
# {:world => true} # to masquerade as World
# {:role_id => some_role_id} # to masquerade as a role
Expand Down
7 changes: 0 additions & 7 deletions netzke-persistence.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Gem::Specification.new do |s|
"README.rdoc"
]
s.files = [
"Gemfile",
"README.rdoc",
"Rakefile",
"app/models/netzke_component_state.rb",
Expand Down Expand Up @@ -155,15 +154,9 @@ Gem::Specification.new do |s|
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<netzke-persistence>, [">= 0"])
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
else
s.add_dependency(%q<netzke-persistence>, [">= 0"])
s.add_dependency(%q<bundler>, [">= 1.0.0"])
end
else
s.add_dependency(%q<netzke-persistence>, [">= 0"])
s.add_dependency(%q<bundler>, [">= 1.0.0"])
end
end

0 comments on commit 3e46802

Please sign in to comment.