erp_tech_svcs 3.0.12 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/erp_tech_svcs/session_controller.rb +1 -1
- data/app/models/attribute_type.rb +2 -0
- data/app/models/attribute_value.rb +2 -0
- data/app/models/audit_log.rb +4 -1
- data/app/models/audit_log_item.rb +2 -0
- data/app/models/audit_log_item_type.rb +2 -0
- data/app/models/audit_log_type.rb +2 -0
- data/app/models/capability.rb +2 -1
- data/app/models/capability_type.rb +2 -0
- data/app/models/extensions/category.rb +3 -0
- data/app/models/extensions/compass_ae_instance.rb +3 -0
- data/app/models/file_asset.rb +3 -1
- data/app/models/group.rb +5 -18
- data/app/models/scope_type.rb +1 -0
- data/app/models/security_role.rb +2 -0
- data/app/models/user.rb +29 -42
- data/app/views/user_mailer/activation_needed_email.html.erb +1 -1
- data/app/views/user_mailer/reset_password_email.html.erb +1 -1
- data/config/initializers/erp_tech_svcs.rb +2 -0
- data/db/data_migrations/20121130212146_note_capabilities.rb +2 -2
- data/db/migrate/20080805000010_base_tech_services.rb +3 -3
- data/lib/erp_tech_svcs/config.rb +4 -0
- data/lib/erp_tech_svcs/extensions/active_record/acts_as_versioned.rb +105 -106
- data/lib/erp_tech_svcs/extensions/active_record/has_capability_accessors.rb +4 -10
- data/lib/erp_tech_svcs/extensions/active_record/has_security_roles.rb +2 -0
- data/lib/erp_tech_svcs/extensions/active_record/protected_with_capabilities.rb +28 -53
- data/lib/erp_tech_svcs/extensions/railties/action_view/base.rb +8 -0
- data/lib/erp_tech_svcs/extensions/railties/action_view/helpers/include_helper.rb +28 -0
- data/lib/erp_tech_svcs/extensions.rb +3 -0
- data/lib/erp_tech_svcs/file_support/railties/s3_resolver.rb +1 -1
- data/lib/erp_tech_svcs/sms_wrapper/clickatell.rb +3 -3
- data/lib/erp_tech_svcs/utils/compass_access_negotiator.rb +4 -6
- data/lib/erp_tech_svcs/version.rb +2 -2
- data/lib/erp_tech_svcs.rb +2 -1
- data/spec/dummy/config/application.rb +6 -0
- data/spec/dummy/config/environments/spec.rb +3 -0
- data/spec/dummy/config/s3.yml +23 -0
- data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +14 -0
- data/spec/dummy/db/migrate/{20130105133955_base_erp_services.erp_base_erp_svcs.rb → 20130107214445_base_erp_services.erp_base_erp_svcs.rb} +0 -0
- data/spec/dummy/db/migrate/{20130105133956_base_tech_services.erp_tech_svcs.rb → 20130107214446_base_tech_services.erp_tech_svcs.rb} +0 -0
- data/spec/dummy/db/migrate/{20130105133957_create_has_attribute_tables.erp_tech_svcs.rb → 20130107214447_create_has_attribute_tables.erp_tech_svcs.rb} +0 -0
- data/spec/dummy/db/migrate/{20130105133958_create_groups.erp_tech_svcs.rb → 20130107214448_create_groups.erp_tech_svcs.rb} +0 -0
- data/spec/dummy/db/migrate/{20130105133959_upgrade_security.erp_tech_svcs.rb → 20130107214449_upgrade_security.erp_tech_svcs.rb} +0 -0
- data/spec/dummy/db/migrate/{20130105133960_upgrade_security2.erp_tech_svcs.rb → 20130107214450_upgrade_security2.erp_tech_svcs.rb} +0 -0
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/spec.log +15314 -121571
- data/spec/dummy/move_test_tmp/file_asset_spec_text.txt +1 -0
- data/spec/lib/erp_tech_svcs/extensions/active_record/has_roles_spec.rb +6 -6
- data/spec/lib/file_support/s3_manager_spec.rb +1 -0
- data/spec/models/audit_log_spec.rb +1 -1
- data/spec/models/file_asset_spec.rb +14 -5
- data/spec/models/group_spec.rb +41 -0
- data/spec/models/security_role_spec.rb +26 -0
- data/spec/models/user_spec.rb +12 -2
- data/spec/spec_helper.rb +12 -7
- metadata +65 -48
- data/db/data_migrations/upgrade/20120727152144_set_image_dimensions_on_file_assets.rb +0 -13
- data/db/migrate/upgrade/20111109161549_add_capabilites.rb +0 -56
- data/db/migrate/upgrade/20111109161550_update_roles.rb +0 -35
- data/db/migrate/upgrade/20111109161551_update_user.rb +0 -88
- data/db/migrate/upgrade/20120329161641_add_file_asset_indexes.rb +0 -22
- data/db/migrate/upgrade/20120517203052_add_queue_to_delayed_jobs.rb +0 -13
- data/db/migrate/upgrade/20120725205131_add_image_dimension_columns_to_file_asset.rb +0 -15
- data/lib/erp_tech_svcs/application_installer.rb +0 -102
- data/lib/erp_tech_svcs/utils/attachment_fu_patch.rb +0 -15
- data/lib/erp_tech_svcs/utils/compass_pdf.rb +0 -72
- data/lib/erp_tech_svcs/utils/pdf_processor.rb +0 -106
- data/spec/dummy/log/adam.log +0 -1
- data/spec/factories/role.rb +0 -5
- data/spec/models/role_spec.rb +0 -17
- data/spec/models/secured_model_spec.rb +0 -22
@@ -0,0 +1 @@
|
|
1
|
+
#Empty File
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe ErpTechSvcs::Extensions::ActiveRecord::
|
3
|
+
describe ErpTechSvcs::Extensions::ActiveRecord::HasSecurityRoles do
|
4
4
|
before(:all) do
|
5
|
-
@user =
|
6
|
-
@user_2 =
|
7
|
-
@admin_role = SecurityRole.create(:internal_identifier => 'admin')
|
8
|
-
@employee_role = SecurityRole.create(:internal_identifier => 'employee')
|
9
|
-
@manager_role = SecurityRole.create(:internal_identifier => 'manager')
|
5
|
+
@user = FactoryGirl.create(:user)
|
6
|
+
@user_2 = FactoryGirl.create(:user)
|
7
|
+
@admin_role = SecurityRole.create(:description => 'Admin', :internal_identifier => 'admin')
|
8
|
+
@employee_role = SecurityRole.create(:description => 'Employee', :internal_identifier => 'employee')
|
9
|
+
@manager_role = SecurityRole.create(:description => 'Manager', :internal_identifier => 'manager')
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should allow you to add a role" do
|
@@ -65,6 +65,7 @@ describe ErpTechSvcs::FileSupport::S3Manager do
|
|
65
65
|
@file_support.exists?('test_rename.txt').should eq true
|
66
66
|
|
67
67
|
result, message, is_directory = @file_support.delete_file('test_rename.txt')
|
68
|
+
result.should eq true
|
68
69
|
@file_support.exists?('test_rename.txt').should eq false
|
69
70
|
|
70
71
|
result, message = @file_support.rename_file('not_real.txt', 'test_rename.txt')
|
@@ -24,11 +24,13 @@ describe FileAsset do
|
|
24
24
|
describe "class methods" do
|
25
25
|
|
26
26
|
it "should have method to get valid extensions based on subclass" do
|
27
|
-
TextFile.valid_extensions.should eq %w(.txt .text)
|
27
|
+
TextFile.valid_extensions.should eq %w(.txt .TXT .text)
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should have method to get all valid extensions for all subclasses" do
|
31
|
-
FileAsset.all_valid_extensions.should eq [".jpg", ".
|
31
|
+
FileAsset.all_valid_extensions.should eq [".jpg", ".JPG", ".jpeg", ".JPEG", ".gif", ".GIF", ".png", ".PNG", ".ico", ".ICO",
|
32
|
+
".bmp", ".BMP", ".tif", ".tiff", ".TIF", ".TIFF", ".txt", ".TXT", ".text", ".swf", ".SWF",
|
33
|
+
".js", ".JS", ".css", ".CSS", ".erb", ".haml", ".liquid", ".builder", ".html", ".HTML", ".xml", ".XML", ".pdf", ".PDF"]
|
32
34
|
end
|
33
35
|
|
34
36
|
it "should be able to lookup subclass based on extension" do
|
@@ -57,18 +59,25 @@ describe FileAsset do
|
|
57
59
|
end
|
58
60
|
|
59
61
|
it "should allow you to move a file" do
|
60
|
-
new_path = File.join(
|
62
|
+
new_path = File.join('move_test_tmp')
|
61
63
|
|
62
64
|
File.exists?(@base_path).should eq true
|
63
|
-
|
64
65
|
result, message = @file_asset.move(new_path)
|
65
66
|
result.should eq true
|
66
67
|
File.exists?(@base_path).should eq false
|
67
|
-
File.exists?(File.join(new_path,@name)).should eq true
|
68
|
+
File.exists?(File.join(Rails.root,new_path,@name)).should eq true
|
68
69
|
|
69
70
|
FileUtils.rm_rf(new_path)
|
70
71
|
end
|
71
72
|
|
73
|
+
it "should allow you to secure a file with capabilities" do
|
74
|
+
@file_asset.protected_with_capability?('download').should eq false
|
75
|
+
@file_asset.add_capability('download')
|
76
|
+
@file_asset.protected_with_capability?('download').should eq true
|
77
|
+
@file_asset.remove_capability('download')
|
78
|
+
@file_asset.protected_with_capability?('download').should eq false
|
79
|
+
end
|
80
|
+
|
72
81
|
after(:all) do
|
73
82
|
@file_asset.destroy
|
74
83
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Group do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@group = Group.create(:description => "Test Group")
|
7
|
+
@user = FactoryGirl.create(:user)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should allow you to add and remove roles" do
|
11
|
+
role = SecurityRole.create(:description => "Test Role", :internal_identifier => 'test role')
|
12
|
+
@group.has_role?(role).should eq false
|
13
|
+
@group.add_role(role)
|
14
|
+
@group.has_role?(role).should eq true
|
15
|
+
@group.remove_role(role)
|
16
|
+
@group.has_role?(role).should eq false
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should allow you to add and remove capabilities" do
|
20
|
+
c = FileAsset.add_capability('upload')
|
21
|
+
@group.capabilities.include?(c).should eq false
|
22
|
+
@group.add_capability(c)
|
23
|
+
@group.capabilities.include?(c).should eq true
|
24
|
+
@group.remove_capability(c)
|
25
|
+
@group.capabilities.include?(c).should eq false
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should allow you to add and remove users" do
|
29
|
+
@group.users.include?(@user).should eq false
|
30
|
+
@group.add_user(@user)
|
31
|
+
@group.users.include?(@user).should eq true
|
32
|
+
@group.remove_user(@user)
|
33
|
+
@group.users.include?(@user).should eq false
|
34
|
+
end
|
35
|
+
|
36
|
+
after(:all) do
|
37
|
+
User.destroy_all
|
38
|
+
SecurityRole.destroy_all
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SecurityRole do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@role = SecurityRole.create(:description => "Test Role", :internal_identifier => 'test role')
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should allow you to add and remove capabilities" do
|
10
|
+
c = FileAsset.add_capability('upload')
|
11
|
+
@role.capabilities.include?(c).should eq false
|
12
|
+
@role.add_capability(c)
|
13
|
+
@role.capabilities.include?(c).should eq true
|
14
|
+
@role.remove_capability(c)
|
15
|
+
@role.capabilities.include?(c).should eq false
|
16
|
+
end
|
17
|
+
|
18
|
+
it "can transform into xml" do
|
19
|
+
@role.to_xml
|
20
|
+
end
|
21
|
+
|
22
|
+
after(:all) do
|
23
|
+
SecurityRole.destroy_all
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/spec/models/user_spec.rb
CHANGED
@@ -3,17 +3,27 @@ require 'spec_helper'
|
|
3
3
|
describe User do
|
4
4
|
|
5
5
|
before(:all) do
|
6
|
-
@user =
|
6
|
+
@user = FactoryGirl.create(:user)
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should allow you to add and remove roles" do
|
10
|
-
role = SecurityRole.create(:internal_identifier => '
|
10
|
+
role = SecurityRole.create(:description => "Test Role", :internal_identifier => 'test role')
|
11
|
+
@user.has_role?(role).should eq false
|
11
12
|
@user.add_role(role)
|
12
13
|
@user.has_role?(role).should eq true
|
13
14
|
@user.remove_role(role)
|
14
15
|
@user.has_role?(role).should eq false
|
15
16
|
end
|
16
17
|
|
18
|
+
it "should allow you to add and remove capabilities" do
|
19
|
+
c = FileAsset.add_capability('upload')
|
20
|
+
@user.has_capability?('upload','FileAsset').should eq false
|
21
|
+
@user.add_capability(c)
|
22
|
+
@user.has_capability?('upload','FileAsset').should eq true
|
23
|
+
@user.remove_capability(c)
|
24
|
+
@user.has_capability?('upload','FileAsset').should eq false
|
25
|
+
end
|
26
|
+
|
17
27
|
it "should allow you to add instance attributes" do
|
18
28
|
@user.add_instance_attribute(:test, 'result')
|
19
29
|
@user.instance_attributes[:test].should eq 'result'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'spork'
|
2
2
|
require 'rake'
|
3
|
+
require 'factory_girl'
|
3
4
|
|
4
5
|
Spork.prefork do
|
5
6
|
# Loading more in this block will cause your tests to run faster. However,
|
@@ -28,9 +29,10 @@ Spork.prefork do
|
|
28
29
|
|
29
30
|
require 'rspec/rails'
|
30
31
|
require 'erp_dev_svcs'
|
31
|
-
|
32
|
+
|
32
33
|
RSpec.configure do |config|
|
33
34
|
config.use_transactional_fixtures = true
|
35
|
+
config.include FactoryGirl::Syntax::Methods
|
34
36
|
config.include Sorcery::TestHelpers::Rails
|
35
37
|
config.include ErpDevSvcs
|
36
38
|
config.include ErpDevSvcs::ControllerSupport, :type => :controller
|
@@ -40,13 +42,17 @@ end
|
|
40
42
|
Spork.each_run do
|
41
43
|
#We have to execute the migrations from dummy app directory
|
42
44
|
Dir.chdir DUMMY_APP_ROOT
|
43
|
-
`rake db:drop`
|
45
|
+
`rake db:drop RAILS_ENV=spec`
|
44
46
|
Dir.chdir ENGINE_RAILS_ROOT
|
45
47
|
|
46
|
-
#We have to execute the
|
48
|
+
#We have to execute the migratiapp:compass_ae:install:data_migrationsons from dummy app directory
|
47
49
|
Dir.chdir DUMMY_APP_ROOT
|
48
|
-
|
49
|
-
|
50
|
+
|
51
|
+
|
52
|
+
`rake compass_ae:install:migrations RAILS_ENV=spec`
|
53
|
+
`rake compass_ae:install:data_migrations RAILS_ENV=spec`
|
54
|
+
`rake db:migrate RAILS_ENV=spec`
|
55
|
+
`rake db:migrate_data RAILS_ENV=spec`
|
50
56
|
Dir.chdir ENGINE_RAILS_ROOT
|
51
57
|
|
52
58
|
ErpDevSvcs::FactorySupport.load_engine_factories
|
@@ -58,6 +64,5 @@ Spork.each_run do
|
|
58
64
|
#Need to explictly load the files in lib/ until we figure out how to
|
59
65
|
#get rails to autoload them for spec like it used to...
|
60
66
|
Dir[File.join(ENGINE_RAILS_ROOT, "lib/**/*.rb")].each {|f| load f}
|
61
|
-
|
62
|
-
Dir[File.join(ENGINE_RAILS_ROOT, "config/**/*.rb")].each {|f| load f}
|
67
|
+
Dir[File.join(ENGINE_RAILS_ROOT, "app/models/extensions/**/*.rb")].each {|f| load f}
|
63
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_tech_svcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erp_base_erp_svcs
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '3.
|
21
|
+
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '3.
|
29
|
+
version: '3.1'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: erp_dev_svcs
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: '3.
|
37
|
+
version: '3.1'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: '3.
|
45
|
+
version: '3.1'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: aws-sdk
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.6.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.6.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: delayed_job_active_record
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.3.
|
69
|
+
version: 0.3.3
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.3.
|
77
|
+
version: 0.3.3
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: paperclip
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - '='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 3.
|
85
|
+
version: 3.3.1
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - '='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 3.
|
93
|
+
version: 3.3.1
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: pdfkit
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.
|
101
|
+
version: 0.5.2
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.
|
109
|
+
version: 0.5.2
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: sorcery
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.7.
|
117
|
+
version: 0.7.13
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,23 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - '='
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.7.
|
125
|
+
version: 0.7.13
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: mail_alternatives_with_attachments
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - '='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 1.0.0
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - '='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 1.0.0
|
126
142
|
description: This engine is implemented with the premise that services like logging,
|
127
143
|
tracing and encryption would likely already exist in many organizations, so they
|
128
144
|
are factored here so they can easily be re-implemented. There are default implementations
|
@@ -150,6 +166,8 @@ files:
|
|
150
166
|
- app/models/capability_accessor.rb
|
151
167
|
- app/models/capability_type.rb
|
152
168
|
- app/models/encryption_key.rb
|
169
|
+
- app/models/extensions/category.rb
|
170
|
+
- app/models/extensions/compass_ae_instance.rb
|
153
171
|
- app/models/extensions/contact_purpose.rb
|
154
172
|
- app/models/extensions/contact_type.rb
|
155
173
|
- app/models/extensions/note.rb
|
@@ -177,19 +195,11 @@ files:
|
|
177
195
|
- db/data_migrations/20111111144706_setup_audit_log_types.rb
|
178
196
|
- db/data_migrations/20121116155018_create_group_relationship_and_role_types.rb
|
179
197
|
- db/data_migrations/20121130212146_note_capabilities.rb
|
180
|
-
- db/data_migrations/upgrade/20120727152144_set_image_dimensions_on_file_assets.rb
|
181
198
|
- db/migrate/20080805000010_base_tech_services.rb
|
182
199
|
- db/migrate/20111117183144_create_has_attribute_tables.rb
|
183
200
|
- db/migrate/20121116151510_create_groups.rb
|
184
201
|
- db/migrate/20121126171612_upgrade_security.rb
|
185
202
|
- db/migrate/20121126173506_upgrade_security2.rb
|
186
|
-
- db/migrate/upgrade/20111109161549_add_capabilites.rb
|
187
|
-
- db/migrate/upgrade/20111109161550_update_roles.rb
|
188
|
-
- db/migrate/upgrade/20111109161551_update_user.rb
|
189
|
-
- db/migrate/upgrade/20120329161641_add_file_asset_indexes.rb
|
190
|
-
- db/migrate/upgrade/20120517203052_add_queue_to_delayed_jobs.rb
|
191
|
-
- db/migrate/upgrade/20120725205131_add_image_dimension_columns_to_file_asset.rb
|
192
|
-
- lib/erp_tech_svcs/application_installer.rb
|
193
203
|
- lib/erp_tech_svcs/config.rb
|
194
204
|
- lib/erp_tech_svcs/engine.rb
|
195
205
|
- lib/erp_tech_svcs/erp_tech_svcs_audit_log.rb
|
@@ -200,6 +210,8 @@ files:
|
|
200
210
|
- lib/erp_tech_svcs/extensions/active_record/has_relational_dynamic_attributes.rb
|
201
211
|
- lib/erp_tech_svcs/extensions/active_record/has_security_roles.rb
|
202
212
|
- lib/erp_tech_svcs/extensions/active_record/protected_with_capabilities.rb
|
213
|
+
- lib/erp_tech_svcs/extensions/railties/action_view/base.rb
|
214
|
+
- lib/erp_tech_svcs/extensions/railties/action_view/helpers/include_helper.rb
|
203
215
|
- lib/erp_tech_svcs/extensions/sorcery/user_activation.rb
|
204
216
|
- lib/erp_tech_svcs/extensions.rb
|
205
217
|
- lib/erp_tech_svcs/file_support/base.rb
|
@@ -214,12 +226,9 @@ files:
|
|
214
226
|
- lib/erp_tech_svcs/sessions/delete_expired_sessions_service.rb
|
215
227
|
- lib/erp_tech_svcs/sms_wrapper/clickatell.rb
|
216
228
|
- lib/erp_tech_svcs/sms_wrapper.rb
|
217
|
-
- lib/erp_tech_svcs/utils/attachment_fu_patch.rb
|
218
229
|
- lib/erp_tech_svcs/utils/compass_access_negotiator.rb
|
219
230
|
- lib/erp_tech_svcs/utils/compass_logger.rb
|
220
|
-
- lib/erp_tech_svcs/utils/compass_pdf.rb
|
221
231
|
- lib/erp_tech_svcs/utils/default_nested_set_methods.rb
|
222
|
-
- lib/erp_tech_svcs/utils/pdf_processor.rb
|
223
232
|
- lib/erp_tech_svcs/version.rb
|
224
233
|
- lib/erp_tech_svcs.rb
|
225
234
|
- lib/tasks/erp_tech_svcs_tasks.rake
|
@@ -245,6 +254,7 @@ files:
|
|
245
254
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
246
255
|
- spec/dummy/config/locales/en.yml
|
247
256
|
- spec/dummy/config/routes.rb
|
257
|
+
- spec/dummy/config/s3.yml
|
248
258
|
- spec/dummy/config.ru
|
249
259
|
- spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb
|
250
260
|
- spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb
|
@@ -252,18 +262,19 @@ files:
|
|
252
262
|
- spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb
|
253
263
|
- spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb
|
254
264
|
- spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb
|
265
|
+
- spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb
|
255
266
|
- spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb
|
256
267
|
- spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb
|
257
|
-
- spec/dummy/db/migrate/
|
258
|
-
- spec/dummy/db/migrate/
|
259
|
-
- spec/dummy/db/migrate/
|
260
|
-
- spec/dummy/db/migrate/
|
261
|
-
- spec/dummy/db/migrate/
|
262
|
-
- spec/dummy/db/migrate/
|
268
|
+
- spec/dummy/db/migrate/20130107214445_base_erp_services.erp_base_erp_svcs.rb
|
269
|
+
- spec/dummy/db/migrate/20130107214446_base_tech_services.erp_tech_svcs.rb
|
270
|
+
- spec/dummy/db/migrate/20130107214447_create_has_attribute_tables.erp_tech_svcs.rb
|
271
|
+
- spec/dummy/db/migrate/20130107214448_create_groups.erp_tech_svcs.rb
|
272
|
+
- spec/dummy/db/migrate/20130107214449_upgrade_security.erp_tech_svcs.rb
|
273
|
+
- spec/dummy/db/migrate/20130107214450_upgrade_security2.erp_tech_svcs.rb
|
263
274
|
- spec/dummy/db/schema.rb
|
264
275
|
- spec/dummy/db/spec.sqlite3
|
265
|
-
- spec/dummy/log/adam.log
|
266
276
|
- spec/dummy/log/spec.log
|
277
|
+
- spec/dummy/move_test_tmp/file_asset_spec_text.txt
|
267
278
|
- spec/dummy/public/404.html
|
268
279
|
- spec/dummy/public/422.html
|
269
280
|
- spec/dummy/public/500.html
|
@@ -271,7 +282,6 @@ files:
|
|
271
282
|
- spec/dummy/Rakefile
|
272
283
|
- spec/dummy/script/rails
|
273
284
|
- spec/factories/capability_type.rb
|
274
|
-
- spec/factories/role.rb
|
275
285
|
- spec/factories/users.rb
|
276
286
|
- spec/lib/erp_tech_svcs/extensions/active_record/has_roles_spec.rb
|
277
287
|
- spec/lib/file_support/file_system_manager_spec.rb
|
@@ -279,8 +289,8 @@ files:
|
|
279
289
|
- spec/models/audit_log_spec.rb
|
280
290
|
- spec/models/audit_log_type_spec.rb
|
281
291
|
- spec/models/file_asset_spec.rb
|
282
|
-
- spec/models/
|
283
|
-
- spec/models/
|
292
|
+
- spec/models/group_spec.rb
|
293
|
+
- spec/models/security_role_spec.rb
|
284
294
|
- spec/models/user_spec.rb
|
285
295
|
- spec/spec_helper.rb
|
286
296
|
homepage: http://development.compassagile.com
|
@@ -295,15 +305,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
305
|
- - ! '>='
|
296
306
|
- !ruby/object:Gem::Version
|
297
307
|
version: '0'
|
308
|
+
segments:
|
309
|
+
- 0
|
310
|
+
hash: 697401427352755655
|
298
311
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
299
312
|
none: false
|
300
313
|
requirements:
|
301
314
|
- - ! '>='
|
302
315
|
- !ruby/object:Gem::Version
|
303
316
|
version: '0'
|
317
|
+
segments:
|
318
|
+
- 0
|
319
|
+
hash: 697401427352755655
|
304
320
|
requirements: []
|
305
321
|
rubyforge_project:
|
306
|
-
rubygems_version: 1.8.
|
322
|
+
rubygems_version: 1.8.24
|
307
323
|
signing_key:
|
308
324
|
specification_version: 3
|
309
325
|
summary: This engine is implemented with the premise that services like logging, tracing
|
@@ -329,6 +345,7 @@ test_files:
|
|
329
345
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
330
346
|
- spec/dummy/config/locales/en.yml
|
331
347
|
- spec/dummy/config/routes.rb
|
348
|
+
- spec/dummy/config/s3.yml
|
332
349
|
- spec/dummy/config.ru
|
333
350
|
- spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb
|
334
351
|
- spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb
|
@@ -336,18 +353,19 @@ test_files:
|
|
336
353
|
- spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb
|
337
354
|
- spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb
|
338
355
|
- spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb
|
356
|
+
- spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb
|
339
357
|
- spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb
|
340
358
|
- spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb
|
341
|
-
- spec/dummy/db/migrate/
|
342
|
-
- spec/dummy/db/migrate/
|
343
|
-
- spec/dummy/db/migrate/
|
344
|
-
- spec/dummy/db/migrate/
|
345
|
-
- spec/dummy/db/migrate/
|
346
|
-
- spec/dummy/db/migrate/
|
359
|
+
- spec/dummy/db/migrate/20130107214445_base_erp_services.erp_base_erp_svcs.rb
|
360
|
+
- spec/dummy/db/migrate/20130107214446_base_tech_services.erp_tech_svcs.rb
|
361
|
+
- spec/dummy/db/migrate/20130107214447_create_has_attribute_tables.erp_tech_svcs.rb
|
362
|
+
- spec/dummy/db/migrate/20130107214448_create_groups.erp_tech_svcs.rb
|
363
|
+
- spec/dummy/db/migrate/20130107214449_upgrade_security.erp_tech_svcs.rb
|
364
|
+
- spec/dummy/db/migrate/20130107214450_upgrade_security2.erp_tech_svcs.rb
|
347
365
|
- spec/dummy/db/schema.rb
|
348
366
|
- spec/dummy/db/spec.sqlite3
|
349
|
-
- spec/dummy/log/adam.log
|
350
367
|
- spec/dummy/log/spec.log
|
368
|
+
- spec/dummy/move_test_tmp/file_asset_spec_text.txt
|
351
369
|
- spec/dummy/public/404.html
|
352
370
|
- spec/dummy/public/422.html
|
353
371
|
- spec/dummy/public/500.html
|
@@ -355,7 +373,6 @@ test_files:
|
|
355
373
|
- spec/dummy/Rakefile
|
356
374
|
- spec/dummy/script/rails
|
357
375
|
- spec/factories/capability_type.rb
|
358
|
-
- spec/factories/role.rb
|
359
376
|
- spec/factories/users.rb
|
360
377
|
- spec/lib/erp_tech_svcs/extensions/active_record/has_roles_spec.rb
|
361
378
|
- spec/lib/file_support/file_system_manager_spec.rb
|
@@ -363,7 +380,7 @@ test_files:
|
|
363
380
|
- spec/models/audit_log_spec.rb
|
364
381
|
- spec/models/audit_log_type_spec.rb
|
365
382
|
- spec/models/file_asset_spec.rb
|
366
|
-
- spec/models/
|
367
|
-
- spec/models/
|
383
|
+
- spec/models/group_spec.rb
|
384
|
+
- spec/models/security_role_spec.rb
|
368
385
|
- spec/models/user_spec.rb
|
369
386
|
- spec/spec_helper.rb
|
@@ -1,56 +0,0 @@
|
|
1
|
-
class AddCapabilites < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
unless table_exists?(:capable_models)
|
4
|
-
# create the roles table
|
5
|
-
create_table :capable_models do |t|
|
6
|
-
t.references :capable_model_record, :polymorphic => true
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
|
11
|
-
add_index :capable_models, [:capable_model_record_id, :capable_model_record_type], :name => 'capable_model_record_idx'
|
12
|
-
end
|
13
|
-
|
14
|
-
unless table_exists?(:capability_types)
|
15
|
-
# create the roles table
|
16
|
-
create_table :capability_types do |t|
|
17
|
-
t.string :internal_identifier
|
18
|
-
t.string :description
|
19
|
-
t.timestamps
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
unless table_exists?(:capabilities)
|
24
|
-
# create the roles table
|
25
|
-
create_table :capabilities do |t|
|
26
|
-
t.string :resource
|
27
|
-
t.references :capability_type
|
28
|
-
t.timestamps
|
29
|
-
end
|
30
|
-
|
31
|
-
add_index :capabilities, :capability_type_id
|
32
|
-
end
|
33
|
-
|
34
|
-
unless table_exists?(:capabilities_capable_models)
|
35
|
-
# create the roles table
|
36
|
-
create_table :capabilities_capable_models, :id => false do |t|
|
37
|
-
t.references :capable_model
|
38
|
-
t.references :capability
|
39
|
-
t.timestamps
|
40
|
-
end
|
41
|
-
|
42
|
-
add_index :capabilities_capable_models, :capable_model_id
|
43
|
-
add_index :capabilities_capable_models, :capability_id
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def down
|
48
|
-
[
|
49
|
-
:capable_models, :capability_types, :capabilities,:capabilities_capable_models
|
50
|
-
].each do |tbl|
|
51
|
-
if table_exists?(tbl)
|
52
|
-
drop_table tbl
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
class UpdateRoles < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
|
4
|
-
if table_exists?(:roles_users)
|
5
|
-
roles_users = ActiveRecord::Base.connection.select_all("select * from roles_users")
|
6
|
-
roles_users.each do |role_user|
|
7
|
-
secured_model = SecuredModel.find_by_secured_record_id_and_secured_record_type(role_user['user_id'], 'User')
|
8
|
-
if secured_model.nil?
|
9
|
-
secured_model = SecuredModel.new
|
10
|
-
secured_model.secured_record = User.find(role_user['user_id'])
|
11
|
-
secured_model.save
|
12
|
-
end
|
13
|
-
secured_model.roles << Role.find(role_user['role_id'])
|
14
|
-
end
|
15
|
-
|
16
|
-
roles_widgets = ActiveRecord::Base.connection.select_all("select * from roles_widgets")
|
17
|
-
roles_widgets.each do |role_widget|
|
18
|
-
secured_model = SecuredModel.find_by_secured_record_id_and_secured_record_type(role_widget['widget_id'], 'Widget')
|
19
|
-
if secured_model.nil?
|
20
|
-
secured_model = SecuredModel.new
|
21
|
-
secured_model.secured_record = Widget.find(role_widget['widget_id'])
|
22
|
-
secured_model.save
|
23
|
-
end
|
24
|
-
secured_model.roles << Role.find(role_widget['role_id'])
|
25
|
-
end
|
26
|
-
|
27
|
-
drop_table :roles_users
|
28
|
-
drop_table :roles_widgets
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
def down
|
34
|
-
end
|
35
|
-
end
|