cbac 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,7 +1,6 @@
1
1
  Manifest
2
2
  README.rdoc
3
3
  Rakefile
4
- cbac.gemspec
5
4
  generators/cbac/USAGE
6
5
  generators/cbac/cbac_generator.rb
7
6
  generators/cbac/templates/config/cbac.pristine
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
24
24
  rdoc.rdoc_files.include('lib/**/*.rb')
25
25
  end
26
26
 
27
- Echoe.new('cbac', '0.5.1') do |p|
27
+ Echoe.new('cbac', '0.5.2') do |p|
28
28
  p.summary = "CBAC - Simple authorization system for Rails applications."
29
29
  p.description = "Simple authorization system for Rails applications. Allows you to develop applications with a mixed role based authorization and a context based authorization model. Does not supply authentication."
30
30
  p.url = "http://cbac.rubyforge.org"
@@ -2,22 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cbac}
5
- s.version = "0.5.1"
5
+ s.version = "0.5.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Bert Meerman"]
9
- s.date = %q{2010-07-15}
9
+ s.date = %q{2010-10-27}
10
10
  s.description = %q{Simple authorization system for Rails applications. Allows you to develop applications with a mixed role based authorization and a context based authorization model. Does not supply authentication.}
11
11
  s.email = %q{bertm@rubyforge.org}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/cbac.rb", "lib/cbac/cbac_pristine/pristine.rb", "lib/cbac/cbac_pristine/pristine_file.rb", "lib/cbac/cbac_pristine/pristine_permission.rb", "lib/cbac/cbac_pristine/pristine_role.rb", "lib/cbac/config.rb", "lib/cbac/context_role.rb", "lib/cbac/generic_role.rb", "lib/cbac/known_permission.rb", "lib/cbac/membership.rb", "lib/cbac/permission.rb", "lib/cbac/privilege.rb", "lib/cbac/privilege_set.rb", "lib/cbac/privilege_set_record.rb", "lib/cbac/setup.rb", "tasks/cbac.rake"]
13
- s.files = ["Manifest", "README.rdoc", "Rakefile", "cbac.gemspec", "generators/cbac/USAGE", "generators/cbac/cbac_generator.rb", "generators/cbac/templates/config/cbac.pristine", "generators/cbac/templates/config/context_roles.rb", "generators/cbac/templates/config/privileges.rb", "generators/cbac/templates/controllers/generic_roles_controller.rb", "generators/cbac/templates/controllers/memberships_controller.rb", "generators/cbac/templates/controllers/permissions_controller.rb", "generators/cbac/templates/controllers/upgrade_controller.rb", "generators/cbac/templates/fixtures/cbac_generic_roles.yml", "generators/cbac/templates/fixtures/cbac_memberships.yml", "generators/cbac/templates/fixtures/cbac_permissions.yml", "generators/cbac/templates/migrate/create_cbac_from_scratch.rb", "generators/cbac/templates/migrate/create_cbac_upgrade_path.rb", "generators/cbac/templates/stylesheets/cbac.css", "generators/cbac/templates/tasks/cbac.rake", "generators/cbac/templates/views/generic_roles/index.html.erb", "generators/cbac/templates/views/layouts/cbac.html.erb", "generators/cbac/templates/views/memberships/_update.html.erb", "generators/cbac/templates/views/memberships/index.html.erb", "generators/cbac/templates/views/permissions/_update_context_role.html.erb", "generators/cbac/templates/views/permissions/_update_generic_role.html.erb", "generators/cbac/templates/views/permissions/index.html.erb", "generators/cbac/templates/views/upgrade/index.html.erb", "init.rb", "lib/cbac.rb", "lib/cbac/cbac_pristine/pristine.rb", "lib/cbac/cbac_pristine/pristine_file.rb", "lib/cbac/cbac_pristine/pristine_permission.rb", "lib/cbac/cbac_pristine/pristine_role.rb", "lib/cbac/config.rb", "lib/cbac/context_role.rb", "lib/cbac/generic_role.rb", "lib/cbac/known_permission.rb", "lib/cbac/membership.rb", "lib/cbac/permission.rb", "lib/cbac/privilege.rb", "lib/cbac/privilege_set.rb", "lib/cbac/privilege_set_record.rb", "lib/cbac/setup.rb", "spec/cbac_pristine_file_spec.rb", "spec/cbac_pristine_permission_spec.rb", "spec/cbac_pristine_role_spec.rb", "spec/rcov.opts", "spec/spec.opts", "spec/spec_helper.rb", "tasks/cbac.rake", "test/fixtures/cbac_generic_roles.yml", "test/fixtures/cbac_memberships.yml", "test/fixtures/cbac_permissions.yml", "test/fixtures/cbac_privilege_set.yml", "test/test_cbac_authorize_context_roles.rb", "test/test_cbac_authorize_generic_roles.rb", "test/test_cbac_context_role.rb", "test/test_cbac_privilege.rb", "test/test_cbac_privilege_set.rb"]
13
+ s.files = ["README.rdoc", "Rakefile", "generators/cbac/USAGE", "generators/cbac/cbac_generator.rb", "generators/cbac/templates/config/cbac.pristine", "generators/cbac/templates/config/context_roles.rb", "generators/cbac/templates/config/privileges.rb", "generators/cbac/templates/controllers/generic_roles_controller.rb", "generators/cbac/templates/controllers/memberships_controller.rb", "generators/cbac/templates/controllers/permissions_controller.rb", "generators/cbac/templates/controllers/upgrade_controller.rb", "generators/cbac/templates/fixtures/cbac_generic_roles.yml", "generators/cbac/templates/fixtures/cbac_memberships.yml", "generators/cbac/templates/fixtures/cbac_permissions.yml", "generators/cbac/templates/migrate/create_cbac_from_scratch.rb", "generators/cbac/templates/migrate/create_cbac_upgrade_path.rb", "generators/cbac/templates/stylesheets/cbac.css", "generators/cbac/templates/tasks/cbac.rake", "generators/cbac/templates/views/generic_roles/index.html.erb", "generators/cbac/templates/views/layouts/cbac.html.erb", "generators/cbac/templates/views/memberships/_update.html.erb", "generators/cbac/templates/views/memberships/index.html.erb", "generators/cbac/templates/views/permissions/_update_context_role.html.erb", "generators/cbac/templates/views/permissions/_update_generic_role.html.erb", "generators/cbac/templates/views/permissions/index.html.erb", "generators/cbac/templates/views/upgrade/index.html.erb", "init.rb", "lib/cbac.rb", "lib/cbac/cbac_pristine/pristine.rb", "lib/cbac/cbac_pristine/pristine_file.rb", "lib/cbac/cbac_pristine/pristine_permission.rb", "lib/cbac/cbac_pristine/pristine_role.rb", "lib/cbac/config.rb", "lib/cbac/context_role.rb", "lib/cbac/generic_role.rb", "lib/cbac/known_permission.rb", "lib/cbac/membership.rb", "lib/cbac/permission.rb", "lib/cbac/privilege.rb", "lib/cbac/privilege_set.rb", "lib/cbac/privilege_set_record.rb", "lib/cbac/setup.rb", "spec/cbac_pristine_file_spec.rb", "spec/cbac_pristine_permission_spec.rb", "spec/cbac_pristine_role_spec.rb", "spec/rcov.opts", "spec/spec.opts", "spec/spec_helper.rb", "tasks/cbac.rake", "test/fixtures/cbac_generic_roles.yml", "test/fixtures/cbac_memberships.yml", "test/fixtures/cbac_permissions.yml", "test/fixtures/cbac_privilege_set.yml", "test/test_cbac_authorize_context_roles.rb", "test/test_cbac_authorize_generic_roles.rb", "test/test_cbac_context_role.rb", "test/test_cbac_privilege.rb", "test/test_cbac_privilege_set.rb", "Manifest", "cbac.gemspec"]
14
14
  s.homepage = %q{http://cbac.rubyforge.org}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cbac", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{cbac}
18
18
  s.rubygems_version = %q{1.3.7}
19
19
  s.summary = %q{CBAC - Simple authorization system for Rails applications.}
20
- s.test_files = ["test/test_cbac_context_role.rb", "test/test_cbac_authorize_context_roles.rb", "test/test_cbac_privilege.rb", "test/test_cbac_privilege_set.rb", "test/test_cbac_authorize_generic_roles.rb"]
20
+ s.test_files = ["test/test_cbac_context_role.rb", "test/test_cbac_authorize_context_roles.rb", "test/test_cbac_privilege.rb", "test/test_cbac_authorize_generic_roles.rb", "test/test_cbac_privilege_set.rb"]
21
21
 
22
22
  if s.respond_to? :specification_version then
23
23
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -4,6 +4,6 @@
4
4
 
5
5
  one:
6
6
  id: 1
7
- name: administrators
7
+ name: administrator
8
8
  remarks: Administrators role. Grants full access to the entire system.
9
9
 
@@ -89,7 +89,7 @@
89
89
  end
90
90
 
91
91
  puts "Creating Generic Role: administrators"
92
- admin_role = Cbac::GenericRole.new(:name => "administrators", :remarks => "System administrators - may edit CBAC permissions")
92
+ admin_role = Cbac::GenericRole.new(:name => "administrator", :remarks => "System administrators - may edit CBAC permissions")
93
93
  throw "Failed to save new Generic Role" unless admin_role.save
94
94
 
95
95
  puts "Creating Administrator Membership for user #{adminuser}"
@@ -86,7 +86,9 @@ module Cbac
86
86
 
87
87
  def delete_generic_permissions
88
88
  permissions = Cbac::Permission.find(:all, :conditions => {:context_role => nil})
89
- (permissions.select { |perm| perm.generic_role.name != "administrators" }).each { |p| p.destroy }
89
+ # for backwards compatibility, generic_role name was administrators instead of administrator
90
+ # SMELL: administrator role *only* identified by name
91
+ (permissions.select { |perm| perm.generic_role.name != "administrator" and perm.generic_role.name != "administrators" }).each { |p| p.destroy }
90
92
  end
91
93
 
92
94
  def delete_non_generic_staged_permissions
@@ -81,7 +81,7 @@ describe "CbacPristineFile" do
81
81
 
82
82
  describe "parse the role from a pristine line" do
83
83
  it "should return the admin role if the role is Admin()" do
84
- admin_role = PristineRole.new(:role_id => 0, :role_type => PristineRole.ROLE_TYPES[:admin], :name => 'administrators')
84
+ admin_role = PristineRole.new(:role_id => 0, :role_type => PristineRole.ROLE_TYPES[:admin], :name => 'administrator')
85
85
  PristineRole.stub!(:admin_role).and_return(admin_role)
86
86
  line = "0:+:PrivilegeSet(chat)Admin()"
87
87
 
@@ -89,7 +89,7 @@
89
89
  end
90
90
 
91
91
  puts "Creating Generic Role: administrators"
92
- admin_role = Cbac::GenericRole.new(:name => "administrators", :remarks => "System administrators - may edit CBAC permissions")
92
+ admin_role = Cbac::GenericRole.new(:name => "administrator", :remarks => "System administrators - may edit CBAC permissions")
93
93
  throw "Failed to save new Generic Role" unless admin_role.save
94
94
 
95
95
  puts "Creating Administrator Membership for user #{adminuser}"
@@ -4,6 +4,6 @@
4
4
 
5
5
  one:
6
6
  id: 1
7
- name: administrators
7
+ name: administrator
8
8
  remarks: Administrators role. Grants full access to the entire system.
9
9
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbac
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bert Meerman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-15 00:00:00 +02:00
18
+ date: 2010-10-27 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -44,10 +44,8 @@ extra_rdoc_files:
44
44
  - lib/cbac/setup.rb
45
45
  - tasks/cbac.rake
46
46
  files:
47
- - Manifest
48
47
  - README.rdoc
49
48
  - Rakefile
50
- - cbac.gemspec
51
49
  - generators/cbac/USAGE
52
50
  - generators/cbac/cbac_generator.rb
53
51
  - generators/cbac/templates/config/cbac.pristine
@@ -104,6 +102,8 @@ files:
104
102
  - test/test_cbac_context_role.rb
105
103
  - test/test_cbac_privilege.rb
106
104
  - test/test_cbac_privilege_set.rb
105
+ - Manifest
106
+ - cbac.gemspec
107
107
  has_rdoc: true
108
108
  homepage: http://cbac.rubyforge.org
109
109
  licenses: []
@@ -148,5 +148,5 @@ test_files:
148
148
  - test/test_cbac_context_role.rb
149
149
  - test/test_cbac_authorize_context_roles.rb
150
150
  - test/test_cbac_privilege.rb
151
- - test/test_cbac_privilege_set.rb
152
151
  - test/test_cbac_authorize_generic_roles.rb
152
+ - test/test_cbac_privilege_set.rb