curupira 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of curupira might be problematic. Click here for more details.

Files changed (181) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +19 -0
  5. data/Gemfile +17 -0
  6. data/Gemfile.lock +202 -0
  7. data/README.md +72 -0
  8. data/Rakefile +31 -0
  9. data/app/controllers/curupira/authorized_controller.rb +9 -0
  10. data/app/controllers/curupira/groups_controller.rb +43 -0
  11. data/app/controllers/curupira/passwords_controller.rb +46 -0
  12. data/app/controllers/curupira/roles_controller.rb +43 -0
  13. data/app/controllers/curupira/sessions_controller.rb +30 -0
  14. data/app/controllers/curupira/users_controller.rb +47 -0
  15. data/app/helpers/curupira/authorize_helper.rb +21 -0
  16. data/app/helpers/curupira/relationship_select_options_helper.rb +17 -0
  17. data/app/mailers/curupira/reset_password_mailer.rb +13 -0
  18. data/app/views/curupira/groups/_form.html.erb +28 -0
  19. data/app/views/curupira/groups/_role_group_fields.html.erb +9 -0
  20. data/app/views/curupira/groups/edit.html.erb +3 -0
  21. data/app/views/curupira/groups/index.html.erb +24 -0
  22. data/app/views/curupira/groups/new.html.erb +3 -0
  23. data/app/views/curupira/groups/show.html.erb +32 -0
  24. data/app/views/curupira/passwords/edit.html.erb +14 -0
  25. data/app/views/curupira/passwords/new.html.erb +14 -0
  26. data/app/views/curupira/reset_password_mailer/instructions.html.erb +19 -0
  27. data/app/views/curupira/reset_password_mailer/reseted.html.erb +7 -0
  28. data/app/views/curupira/roles/_authorization_fields.html.erb +10 -0
  29. data/app/views/curupira/roles/_form.html.erb +23 -0
  30. data/app/views/curupira/roles/edit.html.erb +3 -0
  31. data/app/views/curupira/roles/index.html.erb +24 -0
  32. data/app/views/curupira/roles/new.html.erb +3 -0
  33. data/app/views/curupira/roles/show.html.erb +37 -0
  34. data/app/views/curupira/sessions/new.html.erb +17 -0
  35. data/app/views/curupira/shared/_model_links.html.erb +7 -0
  36. data/app/views/curupira/shared/_session_links.html.erb +7 -0
  37. data/app/views/curupira/users/_form.html.erb +43 -0
  38. data/app/views/curupira/users/_group_user_fields.html.erb +20 -0
  39. data/app/views/curupira/users/_role_group_user_fields.html.erb +10 -0
  40. data/app/views/curupira/users/edit.html.erb +3 -0
  41. data/app/views/curupira/users/index.html.erb +28 -0
  42. data/app/views/curupira/users/new.html.erb +3 -0
  43. data/app/views/curupira/users/show.html.erb +28 -0
  44. data/curupira.gemspec +28 -0
  45. data/lib/curupira.rb +16 -0
  46. data/lib/curupira/authorizer.rb +43 -0
  47. data/lib/curupira/rails.rb +30 -0
  48. data/lib/curupira/rails/routes.rb +15 -0
  49. data/lib/curupira/version.rb +3 -0
  50. data/lib/generators/curupira/controllers/controllers_generator.rb +27 -0
  51. data/lib/generators/curupira/install/install_generator.rb +80 -0
  52. data/lib/generators/curupira/install/model_generators_helper.rb +266 -0
  53. data/lib/generators/curupira/routes/routes_generator.rb +21 -0
  54. data/lib/generators/curupira/routes/templates/routes.rb +1 -0
  55. data/lib/generators/curupira/templates/db/migrate/add_curupira_to_users.rb +20 -0
  56. data/lib/generators/curupira/templates/db/migrate/create_action_labels.rb +12 -0
  57. data/lib/generators/curupira/templates/db/migrate/create_authorizations.rb +12 -0
  58. data/lib/generators/curupira/templates/db/migrate/create_features.rb +11 -0
  59. data/lib/generators/curupira/templates/db/migrate/create_group_users.rb +13 -0
  60. data/lib/generators/curupira/templates/db/migrate/create_groups.rb +10 -0
  61. data/lib/generators/curupira/templates/db/migrate/create_role_group_users.rb +12 -0
  62. data/lib/generators/curupira/templates/db/migrate/create_role_groups.rb +13 -0
  63. data/lib/generators/curupira/templates/db/migrate/create_roles.rb +8 -0
  64. data/lib/generators/curupira/templates/db/migrate/sorcery_core.rb +27 -0
  65. data/lib/generators/curupira/templates/models/action_label.rb +2 -0
  66. data/lib/generators/curupira/templates/models/authorization.rb +2 -0
  67. data/lib/generators/curupira/templates/models/feature.rb +2 -0
  68. data/lib/generators/curupira/templates/models/feature_service.rb +4 -0
  69. data/lib/generators/curupira/templates/models/group.rb +2 -0
  70. data/lib/generators/curupira/templates/models/group_user.rb +2 -0
  71. data/lib/generators/curupira/templates/models/role.rb +2 -0
  72. data/lib/generators/curupira/templates/models/role_group.rb +2 -0
  73. data/lib/generators/curupira/templates/models/role_group_user.rb +2 -0
  74. data/lib/generators/curupira/templates/models/service.rb +2 -0
  75. data/lib/generators/curupira/templates/models/user.rb +2 -0
  76. data/lib/generators/curupira/templates/sorcery.rb +462 -0
  77. data/lib/generators/curupira/views/views_generator.rb +27 -0
  78. data/lib/tasks/curupira_tasks.rake +4 -0
  79. data/spec/app_templates/app/models/action_label.rb +2 -0
  80. data/spec/app_templates/app/models/authorization.rb +2 -0
  81. data/spec/app_templates/app/models/feature.rb +2 -0
  82. data/spec/app_templates/app/models/feature_service.rb +2 -0
  83. data/spec/app_templates/app/models/group.rb +4 -0
  84. data/spec/app_templates/app/models/group_user.rb +2 -0
  85. data/spec/app_templates/app/models/role.rb +2 -0
  86. data/spec/app_templates/app/models/role_group.rb +2 -0
  87. data/spec/app_templates/app/models/role_group_user.rb +2 -0
  88. data/spec/app_templates/app/models/service.rb +2 -0
  89. data/spec/app_templates/app/models/user.rb +2 -0
  90. data/spec/app_templates/config/routes.rb +3 -0
  91. data/spec/controllers/controller_spec.rb +40 -0
  92. data/spec/controllers/groups_controller_spec.rb +162 -0
  93. data/spec/controllers/passwords_controller_spec.rb +171 -0
  94. data/spec/controllers/roles_controller_spec.rb +168 -0
  95. data/spec/controllers/sessions_controller_spec.rb +112 -0
  96. data/spec/controllers/users_controller_spec.rb +182 -0
  97. data/spec/curupira/authorization_spec.rb +67 -0
  98. data/spec/dummy/README.rdoc +28 -0
  99. data/spec/dummy/Rakefile +6 -0
  100. data/spec/dummy/app/assets/images/.keep +0 -0
  101. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  102. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  103. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  104. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  105. data/spec/dummy/app/controllers/home_controller.rb +4 -0
  106. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  107. data/spec/dummy/app/mailers/.keep +0 -0
  108. data/spec/dummy/app/models/.keep +0 -0
  109. data/spec/dummy/app/models/action_label.rb +3 -0
  110. data/spec/dummy/app/models/authorization.rb +4 -0
  111. data/spec/dummy/app/models/feature.rb +3 -0
  112. data/spec/dummy/app/models/group.rb +9 -0
  113. data/spec/dummy/app/models/group_user.rb +7 -0
  114. data/spec/dummy/app/models/role.rb +10 -0
  115. data/spec/dummy/app/models/role_group.rb +4 -0
  116. data/spec/dummy/app/models/role_group_user.rb +4 -0
  117. data/spec/dummy/app/models/user.rb +10 -0
  118. data/spec/dummy/app/views/home/index.html.erb +5 -0
  119. data/spec/dummy/app/views/home/test.html.erb +1 -0
  120. data/spec/dummy/app/views/layouts/application.html.erb +19 -0
  121. data/spec/dummy/bin/bundle +3 -0
  122. data/spec/dummy/bin/rails +4 -0
  123. data/spec/dummy/bin/rake +4 -0
  124. data/spec/dummy/bin/setup +29 -0
  125. data/spec/dummy/config.ru +4 -0
  126. data/spec/dummy/config/application.rb +25 -0
  127. data/spec/dummy/config/boot.rb +5 -0
  128. data/spec/dummy/config/database.yml +25 -0
  129. data/spec/dummy/config/environment.rb +5 -0
  130. data/spec/dummy/config/environments/development.rb +46 -0
  131. data/spec/dummy/config/environments/production.rb +79 -0
  132. data/spec/dummy/config/environments/test.rb +44 -0
  133. data/spec/dummy/config/initializers/assets.rb +11 -0
  134. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  135. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  136. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  137. data/spec/dummy/config/initializers/inflections.rb +16 -0
  138. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  139. data/spec/dummy/config/initializers/session_store.rb +3 -0
  140. data/spec/dummy/config/initializers/sorcery.rb +462 -0
  141. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  142. data/spec/dummy/config/locales/en.yml +23 -0
  143. data/spec/dummy/config/routes.rb +6 -0
  144. data/spec/dummy/config/secrets.yml +22 -0
  145. data/spec/dummy/db/migrate/20150305011941_create_role_group_users.rb +12 -0
  146. data/spec/dummy/db/migrate/20150305011942_create_authorizations.rb +12 -0
  147. data/spec/dummy/db/migrate/20150305011944_create_groups.rb +10 -0
  148. data/spec/dummy/db/migrate/20150305011945_create_roles.rb +8 -0
  149. data/spec/dummy/db/migrate/20150305011946_sorcery_core.rb +27 -0
  150. data/spec/dummy/db/migrate/20150305011947_create_group_users.rb +13 -0
  151. data/spec/dummy/db/migrate/20150305011948_create_role_groups.rb +13 -0
  152. data/spec/dummy/db/migrate/20150312181229_create_action_labels.rb +12 -0
  153. data/spec/dummy/db/migrate/20150312181747_create_features.rb +11 -0
  154. data/spec/dummy/db/schema.rb +112 -0
  155. data/spec/dummy/db/seeds.rb +137 -0
  156. data/spec/dummy/lib/assets/.keep +0 -0
  157. data/spec/dummy/log/.keep +0 -0
  158. data/spec/dummy/public/404.html +67 -0
  159. data/spec/dummy/public/422.html +67 -0
  160. data/spec/dummy/public/500.html +66 -0
  161. data/spec/dummy/public/favicon.ico +0 -0
  162. data/spec/features/link_authorize_spec.rb +25 -0
  163. data/spec/features/list_users_spec.rb +38 -0
  164. data/spec/features/log_in_spec.rb +15 -0
  165. data/spec/generators/curupira/install/action_label_spec.rb +53 -0
  166. data/spec/generators/curupira/install/authorization_generator_spec.rb +51 -0
  167. data/spec/generators/curupira/install/feature_generator_spec.rb +52 -0
  168. data/spec/generators/curupira/install/group_user_generator_spec.rb +51 -0
  169. data/spec/generators/curupira/install/install_generators_spec.rb +159 -0
  170. data/spec/generators/curupira/install/role_generator_spec.rb +38 -0
  171. data/spec/generators/curupira/install/role_group_generator_spec.rb +51 -0
  172. data/spec/generators/curupira/install/role_group_user_generator_spec.rb +52 -0
  173. data/spec/helpers/relationship_select_options_helper_spec.rb +18 -0
  174. data/spec/rails_helper.rb +55 -0
  175. data/spec/spec_helper.rb +87 -0
  176. data/spec/support/factories.rb +64 -0
  177. data/spec/support/generator_spec_helpers.rb +42 -0
  178. data/spec/support/helpers_spec.rb +23 -0
  179. data/spec/support/shared_examples/role_generator_shared_example_spec.rb +13 -0
  180. data/spec/support/sorcery.rb +4 -0
  181. metadata +539 -0
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,6 @@
1
+ Rails.application.routes.draw do
2
+ curupira_routes
3
+
4
+ root to: "home#index"
5
+ get "home/test", to: "home#test"
6
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: bd9a169a7774b4fb5a60d22c5e4935653ca32589f556e89820a299fa28cbeb23bfc2872a5c71bf8ec2d34419081e796c116847ad49dd72a6ca41b05316521481
15
+
16
+ test:
17
+ secret_key_base: 747ef4607eeb2058b0c77bfb59e89097ff36d3c8820d05317c05cd2269bfda571b56a623c7dcd5a538d1e1ef7295aa7c53a3c26081c4c85fbde1f5cde01708fc
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,12 @@
1
+ class CreateRoleGroupUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :role_group_users do |t|
4
+ t.belongs_to :role, index: true
5
+ t.belongs_to :group_user, index: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ add_foreign_key :authorizations, :group_users
10
+ add_foreign_key :authorizations, :roles
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateAuthorizations < ActiveRecord::Migration
2
+ def change
3
+ create_table :authorizations do |t|
4
+ t.belongs_to :feature, index: true
5
+ t.belongs_to :role, index: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ add_foreign_key :authorizations, :features
10
+ add_foreign_key :authorizations, :roles
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ class CreateGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :groups do |t|
4
+ t.string :name
5
+ t.boolean :active
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :roles do |t|
4
+ t.string :name, null: false
5
+ t.boolean :active, default: true
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,27 @@
1
+ class SorceryCore < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :email, null: false
5
+ t.string :name, null: false
6
+ t.boolean :active, default: true
7
+ t.string :username
8
+ t.string :crypted_password
9
+ t.string :salt
10
+ t.string :reset_password_token, default: nil
11
+ t.datetime :reset_password_token_expires_at, default: nil
12
+ t.datetime :reset_password_email_sent_at, default: nil
13
+ t.datetime :last_login_at, default: nil
14
+ t.datetime :last_logout_at, default: nil
15
+ t.datetime :last_activity_at, default: nil
16
+ t.string :last_login_from_ip_address, default: nil
17
+ t.boolean :admin, default: false
18
+
19
+ t.timestamps
20
+ end
21
+
22
+ add_index :users, :username, unique: true
23
+ add_index :users, :reset_password_token
24
+ add_index :users, :last_logout_at
25
+ add_index :users, :last_activity_at
26
+ end
27
+ end
@@ -0,0 +1,13 @@
1
+ class CreateGroupUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :group_users do |t|
4
+ t.belongs_to :group, index: true
5
+ t.belongs_to :user, index: true
6
+ t.boolean :active
7
+
8
+ t.timestamps null: false
9
+ end
10
+ add_foreign_key :group_users, :groups
11
+ add_foreign_key :group_users, :users
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class CreateRoleGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :role_groups do |t|
4
+ t.belongs_to :role, index: true
5
+ t.belongs_to :group, index: true
6
+ t.boolean :active
7
+
8
+ t.timestamps null: false
9
+ end
10
+ add_foreign_key :role_groups, :roles
11
+ add_foreign_key :role_groups, :groups
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class CreateActionLabels < ActiveRecord::Migration
2
+ def change
3
+ create_table :action_labels do |t|
4
+ t.string :name
5
+ t.belongs_to :feature, index: true
6
+ t.boolean :active
7
+
8
+ t.timestamps null: false
9
+ end
10
+ add_foreign_key :action_labels, :features
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ class CreateFeatures < ActiveRecord::Migration
2
+ def change
3
+ create_table :features do |t|
4
+ t.string :name
5
+ t.string :controller
6
+ t.boolean :active, default: true
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,112 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150312181747) do
15
+
16
+ create_table "action_labels", force: :cascade do |t|
17
+ t.string "name"
18
+ t.integer "feature_id"
19
+ t.boolean "active"
20
+ t.datetime "created_at", null: false
21
+ t.datetime "updated_at", null: false
22
+ end
23
+
24
+ add_index "action_labels", ["feature_id"], name: "index_action_labels_on_feature_id"
25
+
26
+ create_table "authorizations", force: :cascade do |t|
27
+ t.integer "feature_id"
28
+ t.integer "role_id"
29
+ t.datetime "created_at", null: false
30
+ t.datetime "updated_at", null: false
31
+ end
32
+
33
+ add_index "authorizations", ["feature_id"], name: "index_authorizations_on_feature_id"
34
+ add_index "authorizations", ["role_id"], name: "index_authorizations_on_role_id"
35
+
36
+ create_table "features", force: :cascade do |t|
37
+ t.string "name"
38
+ t.string "controller"
39
+ t.boolean "active", default: true
40
+ t.datetime "created_at", null: false
41
+ t.datetime "updated_at", null: false
42
+ end
43
+
44
+ create_table "group_users", force: :cascade do |t|
45
+ t.integer "group_id"
46
+ t.integer "user_id"
47
+ t.boolean "active"
48
+ t.datetime "created_at", null: false
49
+ t.datetime "updated_at", null: false
50
+ end
51
+
52
+ add_index "group_users", ["group_id"], name: "index_group_users_on_group_id"
53
+ add_index "group_users", ["user_id"], name: "index_group_users_on_user_id"
54
+
55
+ create_table "groups", force: :cascade do |t|
56
+ t.string "name"
57
+ t.boolean "active"
58
+ t.datetime "created_at", null: false
59
+ t.datetime "updated_at", null: false
60
+ end
61
+
62
+ create_table "role_group_users", force: :cascade do |t|
63
+ t.integer "role_id"
64
+ t.integer "group_user_id"
65
+ t.datetime "created_at", null: false
66
+ t.datetime "updated_at", null: false
67
+ end
68
+
69
+ add_index "role_group_users", ["group_user_id"], name: "index_role_group_users_on_group_user_id"
70
+ add_index "role_group_users", ["role_id"], name: "index_role_group_users_on_role_id"
71
+
72
+ create_table "role_groups", force: :cascade do |t|
73
+ t.integer "role_id"
74
+ t.integer "group_id"
75
+ t.boolean "active"
76
+ t.datetime "created_at", null: false
77
+ t.datetime "updated_at", null: false
78
+ end
79
+
80
+ add_index "role_groups", ["group_id"], name: "index_role_groups_on_group_id"
81
+ add_index "role_groups", ["role_id"], name: "index_role_groups_on_role_id"
82
+
83
+ create_table "roles", force: :cascade do |t|
84
+ t.string "name", null: false
85
+ t.boolean "active", default: true
86
+ end
87
+
88
+ create_table "users", force: :cascade do |t|
89
+ t.string "email", null: false
90
+ t.string "name", null: false
91
+ t.boolean "active", default: true
92
+ t.string "username"
93
+ t.string "crypted_password"
94
+ t.string "salt"
95
+ t.string "reset_password_token"
96
+ t.datetime "reset_password_token_expires_at"
97
+ t.datetime "reset_password_email_sent_at"
98
+ t.datetime "last_login_at"
99
+ t.datetime "last_logout_at"
100
+ t.datetime "last_activity_at"
101
+ t.string "last_login_from_ip_address"
102
+ t.boolean "admin", default: false
103
+ t.datetime "created_at"
104
+ t.datetime "updated_at"
105
+ end
106
+
107
+ add_index "users", ["last_activity_at"], name: "index_users_on_last_activity_at"
108
+ add_index "users", ["last_logout_at"], name: "index_users_on_last_logout_at"
109
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token"
110
+ add_index "users", ["username"], name: "index_users_on_username", unique: true
111
+
112
+ end
@@ -0,0 +1,137 @@
1
+ feature = Feature.create name: "Cadastrar usuário", controller: "curupira/users"
2
+
3
+ action_1 = ActionLabel.create name: "new"
4
+ action_2 = ActionLabel.create name: "create"
5
+
6
+ feature.action_labels = [action_1, action_2]
7
+
8
+ feature.save
9
+
10
+ feature = Feature.create name: "Visualizar usuário", controller: "curupira/users"
11
+
12
+ action_1 = ActionLabel.create name: "index"
13
+ action_2 = ActionLabel.create name: "show"
14
+
15
+ feature.action_labels = [action_1, action_2]
16
+
17
+ feature.save
18
+
19
+ feature = Feature.create name: "Editar usuário", controller: "curupira/users"
20
+
21
+ action_1 = ActionLabel.create name: "edit"
22
+ action_2 = ActionLabel.create name: "update"
23
+
24
+ feature.action_labels = [action_1, action_2]
25
+
26
+ feature = Feature.create name: "Deletar usuário", controller: "curupira/users"
27
+
28
+ action_1 = ActionLabel.create name: "destroy"
29
+
30
+ feature.action_labels = [action_1]
31
+
32
+ feature.save
33
+
34
+ ###############################################
35
+
36
+ feature = Feature.create name: "Cadastrar Perfis", controller: "curupira/roles"
37
+
38
+ action_1 = ActionLabel.create name: "new"
39
+ action_2 = ActionLabel.create name: "create"
40
+
41
+ feature.action_labels = [action_1, action_2]
42
+
43
+ feature.save
44
+
45
+ feature = Feature.create name: "Visualizar Perfis", controller: "curupira/roles"
46
+
47
+ action_1 = ActionLabel.create name: "index"
48
+ action_2 = ActionLabel.create name: "show"
49
+
50
+ feature.action_labels = [action_1, action_2]
51
+
52
+ feature.save
53
+
54
+ feature = Feature.create name: "Editar Perfis", controller: "curupira/roles"
55
+
56
+ action_1 = ActionLabel.create name: "edit"
57
+ action_2 = ActionLabel.create name: "update"
58
+
59
+ feature.action_labels = [action_1, action_2]
60
+
61
+ feature = Feature.create name: "Deletar Perfis", controller: "curupira/roles"
62
+
63
+ action_1 = ActionLabel.create name: "destroy"
64
+
65
+ feature.action_labels = [action_1]
66
+
67
+ feature.save
68
+
69
+ ###############################################
70
+
71
+ feature = Feature.create name: "Cadastrar Grupos", controller: "curupira/groups"
72
+
73
+ action_1 = ActionLabel.create name: "new"
74
+ action_2 = ActionLabel.create name: "create"
75
+
76
+ feature.action_labels = [action_1, action_2]
77
+
78
+ feature.save
79
+
80
+ feature = Feature.create name: "Visualizar Grupos", controller: "curupira/groups"
81
+
82
+ action_1 = ActionLabel.create name: "index"
83
+ action_2 = ActionLabel.create name: "show"
84
+
85
+ feature.action_labels = [action_1, action_2]
86
+
87
+ feature.save
88
+
89
+ feature = Feature.create name: "Editar Grupos", controller: "curupira/groups"
90
+
91
+ action_1 = ActionLabel.create name: "edit"
92
+ action_2 = ActionLabel.create name: "update"
93
+
94
+ feature.action_labels = [action_1, action_2]
95
+
96
+ feature = Feature.create name: "Deletar Grupos", controller: "curupira/groups"
97
+
98
+ action_1 = ActionLabel.create name: "destroy"
99
+
100
+ feature.action_labels = [action_1]
101
+
102
+ feature.save
103
+
104
+ ###############################################
105
+
106
+ feature = Feature.create name: "Cadastrar Grupos", controller: "curupira/groups"
107
+
108
+ action_1 = ActionLabel.create name: "new"
109
+ action_2 = ActionLabel.create name: "create"
110
+
111
+ feature.action_labels = [action_1, action_2]
112
+
113
+ feature.save
114
+
115
+ feature = Feature.create name: "Visualizar Grupos", controller: "curupira/groups"
116
+
117
+ action_1 = ActionLabel.create name: "index"
118
+ action_2 = ActionLabel.create name: "show"
119
+
120
+ feature.action_labels = [action_1, action_2]
121
+
122
+ feature.save
123
+
124
+ feature = Feature.create name: "Editar Grupos", controller: "curupira/groups"
125
+
126
+ action_1 = ActionLabel.create name: "edit"
127
+ action_2 = ActionLabel.create name: "update"
128
+
129
+ feature.action_labels = [action_1, action_2]
130
+
131
+ feature = Feature.create name: "Deletar Grupos", controller: "curupira/groups"
132
+
133
+ action_1 = ActionLabel.create name: "destroy"
134
+
135
+ feature.action_labels = [action_1]
136
+
137
+ feature.save