authentasaurus 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/CHANGELIST +2 -6
  2. data/TODO +0 -5
  3. data/app/controllers/areas_controller.rb +1 -1
  4. data/app/controllers/groups_controller.rb +1 -1
  5. data/app/controllers/permissions_controller.rb +1 -1
  6. data/app/controllers/recoveries_controller.rb +1 -1
  7. data/app/controllers/registrations_controller.rb +1 -1
  8. data/app/controllers/sessions_controller.rb +2 -2
  9. data/app/controllers/user_invitations_controller.rb +1 -1
  10. data/app/controllers/users_controller.rb +1 -1
  11. data/app/controllers/validations_controller.rb +1 -1
  12. data/app/models/area.rb +1 -1
  13. data/app/models/authentasaurus_emailer.rb +6 -6
  14. data/app/models/group.rb +1 -1
  15. data/app/models/permission.rb +1 -1
  16. data/app/models/recovery.rb +1 -1
  17. data/app/models/user_invitation.rb +1 -1
  18. data/app/models/validation.rb +1 -1
  19. data/app/views/authentasaurus_emailer/invitation_mail.html.erb +2 -2
  20. data/app/views/authentasaurus_emailer/recovery_mail.html.erb +2 -2
  21. data/app/views/authentasaurus_emailer/validation_mail.html.erb +2 -2
  22. data/lib/authentasaurus.rb +18 -52
  23. metadata +2 -136
  24. data/app/models/authentasaurus_session.rb +0 -3
  25. data/lib/authentasaurus/ac/acts_as_overrider.rb +0 -48
  26. data/lib/authentasaurus/ac/controllers/areas_controller.rb +0 -75
  27. data/lib/authentasaurus/ac/controllers/groups_controller.rb +0 -77
  28. data/lib/authentasaurus/ac/controllers/permissions_controller.rb +0 -76
  29. data/lib/authentasaurus/ac/controllers/recoveries_controller.rb +0 -67
  30. data/lib/authentasaurus/ac/controllers/registrations_controller.rb +0 -40
  31. data/lib/authentasaurus/ac/controllers/sessions_controller.rb +0 -57
  32. data/lib/authentasaurus/ac/controllers/user_invitations_controller.rb +0 -45
  33. data/lib/authentasaurus/ac/controllers/users_controller.rb +0 -75
  34. data/lib/authentasaurus/ac/controllers/validations_controller.rb +0 -48
  35. data/lib/authentasaurus/ac/routing.rb +0 -86
  36. data/lib/authentasaurus/ar/acts_as_authenticatable.rb +0 -107
  37. data/lib/authentasaurus/ar/acts_as_authenticatable_validatable.rb +0 -35
  38. data/lib/authentasaurus/ar/acts_as_overrider.rb +0 -49
  39. data/lib/authentasaurus/ar/authenticatable.rb +0 -64
  40. data/lib/authentasaurus/ar/migrations.rb +0 -165
  41. data/lib/authentasaurus/ar/models/recovery.rb +0 -34
  42. data/lib/authentasaurus/ar/models/session.rb +0 -78
  43. data/lib/authentasaurus/ar/models/user_invitation.rb +0 -30
  44. data/lib/authentasaurus/ar/models/validation.rb +0 -27
  45. data/lib/authentasaurus/arel/acts_as_authenticatable.rb +0 -67
  46. data/lib/authentasaurus/arel/authenticatable.rb +0 -21
  47. data/lib/authentasaurus/authorization.rb +0 -344
  48. data/lib/authentasaurus/configuration.rb +0 -30
  49. data/lib/authentasaurus/railtie.rb +0 -10
  50. data/lib/generators/authentasaurus/install/USAGE +0 -5
  51. data/lib/generators/authentasaurus/install/install_generator.rb +0 -10
  52. data/lib/generators/authentasaurus/install/templates/authentasaurus_tasks.rake +0 -48
  53. data/lib/generators/authentasaurus/install/templates/defaults.yml +0 -57
  54. data/lib/generators/authentasaurus/views/USAGE +0 -13
  55. data/lib/generators/authentasaurus/views/templates/areas/edit.html.erb +0 -7
  56. data/lib/generators/authentasaurus/views/templates/areas/index.html.erb +0 -11
  57. data/lib/generators/authentasaurus/views/templates/areas/new.html.erb +0 -7
  58. data/lib/generators/authentasaurus/views/templates/areas/show.html.erb +0 -7
  59. data/lib/generators/authentasaurus/views/templates/authentasaurus_emailer/invitation_mail.html.erb +0 -4
  60. data/lib/generators/authentasaurus/views/templates/authentasaurus_emailer/recovery_mail.html.erb +0 -7
  61. data/lib/generators/authentasaurus/views/templates/authentasaurus_emailer/validation_mail.html.erb +0 -6
  62. data/lib/generators/authentasaurus/views/templates/groups/edit.html.erb +0 -7
  63. data/lib/generators/authentasaurus/views/templates/groups/index.html.erb +0 -11
  64. data/lib/generators/authentasaurus/views/templates/groups/new.html.erb +0 -7
  65. data/lib/generators/authentasaurus/views/templates/groups/show.html.erb +0 -7
  66. data/lib/generators/authentasaurus/views/templates/permissions/edit.html.erb +0 -19
  67. data/lib/generators/authentasaurus/views/templates/permissions/index.html.erb +0 -17
  68. data/lib/generators/authentasaurus/views/templates/permissions/new.html.erb +0 -19
  69. data/lib/generators/authentasaurus/views/templates/permissions/show.html.erb +0 -7
  70. data/lib/generators/authentasaurus/views/templates/recoveries/edit.html.erb +0 -24
  71. data/lib/generators/authentasaurus/views/templates/recoveries/new.html.erb +0 -15
  72. data/lib/generators/authentasaurus/views/templates/registrations/new.html.erb +0 -21
  73. data/lib/generators/authentasaurus/views/templates/sessions/new.html.erb +0 -41
  74. data/lib/generators/authentasaurus/views/templates/sessions/no_access.html.erb +0 -1
  75. data/lib/generators/authentasaurus/views/templates/user_invitations/index.html.erb +0 -14
  76. data/lib/generators/authentasaurus/views/templates/user_invitations/new.html.erb +0 -9
  77. data/lib/generators/authentasaurus/views/templates/users/edit.html.erb +0 -27
  78. data/lib/generators/authentasaurus/views/templates/users/index.html.erb +0 -19
  79. data/lib/generators/authentasaurus/views/templates/users/new.html.erb +0 -27
  80. data/lib/generators/authentasaurus/views/templates/users/show.html.erb +0 -11
  81. data/lib/generators/authentasaurus/views/templates/validations/resend_validation_email.html.erb +0 -6
  82. data/lib/generators/authentasaurus/views/templates/validations/validate.html.erb +0 -6
  83. data/lib/generators/authentasaurus/views/views_generator.rb +0 -76
  84. data/rdoc/apple-touch-icon.png +0 -0
  85. data/rdoc/classes/Authentasaurus.html +0 -65
  86. data/rdoc/classes/Authentasaurus/Ac.html +0 -72
  87. data/rdoc/classes/Authentasaurus/Ac/ActsAsOverrider.html +0 -104
  88. data/rdoc/classes/Authentasaurus/Ac/ActsAsOverrider/ClassMethods.html +0 -397
  89. data/rdoc/classes/Authentasaurus/Ac/Routing.html +0 -61
  90. data/rdoc/classes/Authentasaurus/Ac/Routing/InstanceMethods.html +0 -390
  91. data/rdoc/classes/Authentasaurus/Ar.html +0 -77
  92. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatable.html +0 -107
  93. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatable/ClassMethods.html +0 -168
  94. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatable/InstanceMethods.html +0 -357
  95. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatableValidatable.html +0 -109
  96. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatableValidatable/ClassMethods.html +0 -113
  97. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatableValidatable/InstanceMethods.html +0 -54
  98. data/rdoc/classes/Authentasaurus/Ar/ActsAsOverrider.html +0 -104
  99. data/rdoc/classes/Authentasaurus/Ar/ActsAsOverrider/ClassMethods.html +0 -320
  100. data/rdoc/classes/Authentasaurus/Ar/Authenticatable.html +0 -104
  101. data/rdoc/classes/Authentasaurus/Ar/Authenticatable/ClassMethods.html +0 -182
  102. data/rdoc/classes/Authentasaurus/Ar/Migrations.html +0 -63
  103. data/rdoc/classes/Authentasaurus/Ar/Migrations/Columns.html +0 -68
  104. data/rdoc/classes/Authentasaurus/Ar/Migrations/Columns/InstanceMethods.html +0 -106
  105. data/rdoc/classes/Authentasaurus/Ar/Migrations/Tables.html +0 -68
  106. data/rdoc/classes/Authentasaurus/Ar/Migrations/Tables/InstanceMethods.html +0 -703
  107. data/rdoc/classes/Authentasaurus/Arel.html +0 -65
  108. data/rdoc/classes/Authentasaurus/Arel/ActsAsAuthenticatable.html +0 -107
  109. data/rdoc/classes/Authentasaurus/Arel/ActsAsAuthenticatable/ClassMethods.html +0 -139
  110. data/rdoc/classes/Authentasaurus/Arel/ActsAsAuthenticatable/InstanceMethods.html +0 -113
  111. data/rdoc/classes/Authentasaurus/Arel/Authenticatable.html +0 -105
  112. data/rdoc/classes/Authentasaurus/Arel/Authenticatable/ClassMethods.html +0 -119
  113. data/rdoc/classes/Authentasaurus/Authorization.html +0 -230
  114. data/rdoc/classes/Authentasaurus/Authorization/ActionController.html +0 -63
  115. data/rdoc/classes/Authentasaurus/Authorization/ActionController/ClassMethods.html +0 -263
  116. data/rdoc/classes/Authentasaurus/Authorization/ActionController/InstanceMethods.html +0 -54
  117. data/rdoc/classes/Authentasaurus/Authorization/ActionView.html +0 -54
  118. data/rdoc/classes/Authentasaurus/Authorization/CommonInstanceMethods.html +0 -240
  119. data/rdoc/created.rid +0 -1
  120. data/rdoc/css/main.css +0 -278
  121. data/rdoc/css/panel.css +0 -383
  122. data/rdoc/css/reset.css +0 -53
  123. data/rdoc/favicon.ico +0 -0
  124. data/rdoc/files/README_rdoc.html +0 -366
  125. data/rdoc/files/TODO.html +0 -64
  126. data/rdoc/files/lib/authentasaurus/ac/acts_as_overrider_rb.html +0 -52
  127. data/rdoc/files/lib/authentasaurus/ac/routing_rb.html +0 -60
  128. data/rdoc/files/lib/authentasaurus/ar/acts_as_authenticatable_rb.html +0 -52
  129. data/rdoc/files/lib/authentasaurus/ar/acts_as_authenticatable_validatable_rb.html +0 -52
  130. data/rdoc/files/lib/authentasaurus/ar/acts_as_overrider_rb.html +0 -52
  131. data/rdoc/files/lib/authentasaurus/ar/authenticatable_rb.html +0 -52
  132. data/rdoc/files/lib/authentasaurus/ar/migrations_rb.html +0 -52
  133. data/rdoc/files/lib/authentasaurus/arel/acts_as_authenticatable_rb.html +0 -52
  134. data/rdoc/files/lib/authentasaurus/arel/authenticatable_rb.html +0 -72
  135. data/rdoc/files/lib/authentasaurus/authorization_rb.html +0 -208
  136. data/rdoc/i/arrows.png +0 -0
  137. data/rdoc/i/results_bg.png +0 -0
  138. data/rdoc/i/tree_bg.png +0 -0
  139. data/rdoc/index.html +0 -15
  140. data/rdoc/js/jquery-1.3.2.min.js +0 -19
  141. data/rdoc/js/jquery-effect.js +0 -593
  142. data/rdoc/js/main.js +0 -22
  143. data/rdoc/js/searchdoc.js +0 -628
  144. data/rdoc/panel/index.html +0 -71
  145. data/rdoc/panel/search_index.js +0 -1
  146. data/rdoc/panel/tree.js +0 -1
@@ -1,383 +0,0 @@
1
- /* Panel (begin) */
2
- .panel
3
- {
4
- position: absolute;
5
- width: 100%;
6
- height: 100%;
7
- top: 0;
8
- left: 0;
9
- background: #FFF;
10
- z-index: 2;
11
- font-family: "Helvetica Neue", "Arial", sans-serif;
12
- //zoom: 1;
13
- }
14
-
15
- .panel_tree .results,
16
- .panel_results .tree
17
- {
18
- display: none;
19
- }
20
-
21
- /* Header with search box (begin) */
22
- .panel .header
23
- {
24
- width: 100%;
25
- height: 29px;
26
- border-bottom: 1px solid #666;
27
- position: relative;
28
- left: 0; top: 0;
29
- background: #e8e8e8;
30
- }
31
-
32
- .panel .header div
33
- {
34
- margin: 0 7px;
35
- }
36
- .panel .header table
37
- {
38
- height: 29px;
39
- width: 100%;
40
- }
41
-
42
- .panel .header table td
43
- {
44
- vertical-align: middle;
45
- text-align: middle;
46
- }
47
-
48
- .panel .header label
49
- {
50
- position: absolute;
51
- font-size: 12px;
52
- line-height: 29px;
53
- margin-left: 3px;
54
- color: #999;
55
- cursor: text;
56
- }
57
-
58
- .panel .header table input
59
- {
60
- width: 100%;
61
- box-sizing: border-box;
62
- -moz-box-sizing: border-box;
63
- -webkit-box-sizing: border-box;
64
- display: inline-block;
65
- -webkit-appearance: searchfield;
66
- height: 22px;
67
- //height: auto;
68
- }
69
-
70
- /* Header with search box (end) */
71
-
72
-
73
- /* Results (begin) */
74
- .panel .result
75
- {
76
- position: absolute;
77
- top: 30px;
78
- bottom: 0;
79
- left: 0;
80
- width: 100%;
81
- //height: expression((this.parentNode.offsetHeight - 31));
82
- overflow-y: scroll;
83
- overflow-x: hidden;
84
- -overflow-y: hidden;
85
- background: #EDF3FE url(../i/results_bg.png);
86
- z-index: 2;
87
- //zoom:1;
88
- }
89
-
90
- .panel .result ul
91
- {
92
- font-size: 0.8em;
93
- width: 100%;
94
- background: #EDF3FE url(../i/results_bg.png);
95
- //zoom:1;
96
- }
97
-
98
- .panel .result ul li
99
- {
100
- height: 46px;
101
- -height: 50px;
102
- //display: inline;
103
- //width: 100%;
104
- //zoom: 1;
105
- overflow: hidden;
106
- padding: 4px 10px 0 10px;
107
- cursor: pointer;
108
- }
109
-
110
- .panel .result ul li h1
111
- {
112
- font-size: 13px;
113
- font-weight: normal;
114
- color: #333;
115
- margin-bottom: 2px;
116
- white-space: nowrap;
117
- }
118
-
119
- .panel .result ul li p
120
- {
121
- font-size: 11px;
122
- color: #333;
123
- margin-bottom: 2px;
124
- white-space: nowrap;
125
- }
126
-
127
- .panel .result ul li h1 i,
128
- .panel .result ul li p.snippet
129
- {
130
- color: #999;
131
- }
132
-
133
- .panel .result ul li b
134
- {
135
- color: #000;
136
- }
137
-
138
- .panel .result ul li.current
139
- {
140
- background: #3875D7;
141
- }
142
-
143
- .panel .result ul li.current h1,
144
- .panel .result ul li.current p
145
- {
146
- color: #DDD;
147
- }
148
-
149
- .panel .result ul li.current h1 i,
150
- .panel .result ul li.current p.snippet
151
- {
152
- color: #AAA;
153
- }
154
-
155
- .panel .result ul li.current b
156
- {
157
- color: #FFF;
158
- }
159
-
160
-
161
- .panel .result ul li:hover,
162
- .panel .result ul li.selected
163
- {
164
- background: #d0d0d0;
165
- }
166
-
167
- .panel .result ul li.current:hover
168
- {
169
- background: #2965C0;
170
- }
171
-
172
- .panel .result ul li .badge
173
- {
174
- margin-right: 0.4em;
175
- margin-left: -0.2em;
176
- padding: 0 0.2em;
177
- color: #000;
178
- }
179
-
180
- .panel .result ul li .badge_1
181
- {
182
- background: #ACDBF4;
183
- }
184
-
185
- .panel .result ul li.current .badge_1
186
- {
187
- background: #97BFD7;
188
- }
189
-
190
- .panel .result ul li .badge_2
191
- {
192
- background: #ACF3C3;
193
- }
194
-
195
- .panel .result ul li.current .badge_2
196
- {
197
- background: #98D7AC;
198
- }
199
-
200
- .panel .result ul li .badge_3
201
- {
202
- background: #E0F3AC;
203
- }
204
-
205
- .panel .result ul li.current .badge_3
206
- {
207
- background: #C4D798;
208
- }
209
-
210
- .panel .result ul li .badge_4
211
- {
212
- background: #D7CA98;
213
- }
214
-
215
- .panel .result ul li.current .badge_4
216
- {
217
- background: #A6B0AC;
218
- }
219
-
220
- .panel .result ul li .badge_5
221
- {
222
- background: #F3C8AC;
223
- }
224
-
225
- .panel .result ul li.current .badge_5
226
- {
227
- background: #D7B198;
228
- }
229
-
230
- .panel .result ul li .badge_6
231
- {
232
- background: #F3ACC3;
233
- }
234
-
235
- .panel .result ul li.current .badge_6
236
- {
237
- background: #D798AB;
238
- }
239
-
240
- /* Results (end) */
241
-
242
- /* Tree (begin) */ /**/
243
- .panel .tree
244
- {
245
- position: absolute;
246
- top: 30px;
247
- bottom: 0;
248
- left: 0;
249
- width: 100%;
250
- //zoom: 1;
251
- //height: expression((this.parentNode.offsetHeight - 31));
252
- overflow-y: scroll;
253
- overflow-x: hidden;
254
- -overflow-y: hidden;
255
- background: #EDF3FE url(../i/tree_bg.png);
256
- z-index: 30;
257
- }
258
-
259
- .panel .tree ul
260
- {
261
- background: #EDF3FE url(../i/tree_bg.png);
262
- }
263
-
264
- .panel .tree li
265
- {
266
- cursor: pointer;
267
- overflow: hidden;
268
- //height: 23px;
269
- //display: inline;
270
- //zoom: 1;
271
- //width: 100%;
272
- }
273
-
274
-
275
- .panel .tree li .content
276
- {
277
- padding-left: 18px;
278
- padding-top: 5px;
279
- height: 18px;
280
- overflow: hidden;
281
- position: relative;
282
- }
283
-
284
- .panel .tree li .icon
285
- {
286
- width: 10px;
287
- height: 9px;
288
- background: url(../i/arrows.png);
289
- background-position: 0 -9px;
290
- position: absolute;
291
- left: 1px;
292
- top: 8px;
293
- cursor: default;
294
- }
295
-
296
- .panel .tree li.closed .icon
297
- {
298
- background-position: 0 0;
299
- }
300
-
301
- .panel .tree ul li h1
302
- {
303
- font-size: 13px;
304
- font-weight: normal;
305
- color: #000;
306
- margin-bottom: 2px;
307
- white-space: nowrap;
308
- }
309
-
310
- .panel .tree ul li p
311
- {
312
- font-size: 11px;
313
- color: #666;
314
- margin-bottom: 2px;
315
- white-space: nowrap;
316
- }
317
-
318
- .panel .tree ul li h1 i
319
- {
320
- color: #999;
321
- font-style: normal;
322
- }
323
-
324
- .panel .tree ul li.empty
325
- {
326
- cursor: text;
327
- }
328
-
329
- .panel .tree ul li.empty h1,
330
- .panel .tree ul li.empty p
331
- {
332
- color: #666;
333
- font-style: italic;
334
- }
335
-
336
- .panel .tree ul li.current
337
- {
338
- background: #3875D7;
339
- }
340
-
341
- .panel .tree ul li.current .icon
342
- {
343
- background-position: -10px -9px;
344
- }
345
-
346
- .panel .tree ul li.current.closed .icon
347
- {
348
- background-position: -10px 0;
349
- }
350
-
351
- .panel .tree ul li.current h1
352
- {
353
- color: #FFF;
354
- }
355
-
356
- .panel .tree ul li.current p
357
- {
358
- color: #CCC;
359
- }
360
-
361
- .panel .tree ul li.current.empty h1,
362
- .panel .tree ul li.current.empty p
363
- {
364
- color: #999;
365
- }
366
-
367
- .panel .tree ul li:hover
368
- {
369
- background: #d0d0d0;
370
- }
371
-
372
- .panel .tree ul li.current:hover
373
- {
374
- background: #2965C0;
375
- }
376
-
377
- .panel .tree .stopper
378
- {
379
- display: none;
380
- }
381
- /* Tree (end) */ /**/
382
-
383
- /* Panel (end) */
@@ -1,53 +0,0 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/ */
2
- /* v1.0 | 20080212 */
3
-
4
- html, body, div, span, applet, object, iframe,
5
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6
- a, abbr, acronym, address, big, cite, code,
7
- del, dfn, em, font, img, ins, kbd, q, s, samp,
8
- small, strike, strong, sub, sup, tt, var,
9
- b, u, i, center,
10
- dl, dt, dd, ol, ul, li,
11
- fieldset, form, label, legend,
12
- table, caption, tbody, tfoot, thead, tr, th, td {
13
- margin: 0;
14
- padding: 0;
15
- border: 0;
16
- outline: 0;
17
- font-size: 100%;
18
- vertical-align: baseline;
19
- background: transparent;
20
- }
21
- body {
22
- line-height: 1;
23
- }
24
- ol, ul {
25
- list-style: none;
26
- }
27
- blockquote, q {
28
- quotes: none;
29
- }
30
- blockquote:before, blockquote:after,
31
- q:before, q:after {
32
- content: '';
33
- content: none;
34
- }
35
-
36
- /* remember to define focus styles! */
37
- :focus {
38
- outline: 0;
39
- }
40
-
41
- /* remember to highlight inserts somehow! */
42
- ins {
43
- text-decoration: none;
44
- }
45
- del {
46
- text-decoration: line-through;
47
- }
48
-
49
- /* tables still need 'cellspacing="0"' in the markup */
50
- table {
51
- border-collapse: collapse;
52
- border-spacing: 0;
53
- }
Binary file
@@ -1,366 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <title>README.rdoc</title>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
9
- <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
10
- <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
- <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
- <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
13
- </head>
14
-
15
- <body>
16
- <div class="banner">
17
- <h1>
18
- README.rdoc
19
- </h1>
20
- <ul class="files">
21
- <li>README.rdoc</li>
22
- <li>Last modified: Tue Sep 28 23:34:58 +0300 2010</li>
23
- </ul>
24
- </div>
25
-
26
- <div id="bodyContent">
27
- <div id="content">
28
-
29
- <div class="description">
30
- <h2><a href="../classes/Authentasaurus.html">Authentasaurus</a></h2>
31
- <p>
32
- <a href="../classes/Authentasaurus.html">Authentasaurus</a> is a dynamic
33
- group/permission based authentication and authorization engine plugin, its
34
- simple to use and easy to setup.
35
- </p>
36
- <p>
37
- Most helpers are inspired by Devise.
38
- </p>
39
- <h2>Installation</h2>
40
- <p>
41
- To start using <a href="../classes/Authentasaurus.html">Authentasaurus</a>
42
- follow these simple steps :
43
- </p>
44
- <ol>
45
- <li>install authentasaurus gem by running the following command
46
-
47
- <pre>
48
- gem install authentasaurus
49
- </pre>
50
- </li>
51
- <li>add authentasaurus to your application environment; in
52
- config/environment.rb
53
-
54
- <pre>
55
- config.gem &quot;authentasaurus&quot;
56
- </pre>
57
- </li>
58
- <li>generate authentasaurus configuration and tasks in your application
59
-
60
- <pre>
61
- script/generate authentasaurus
62
- </pre>
63
- </li>
64
- <li>setup your migrations using the migration helpers
65
-
66
- <pre>
67
- in the migration up method just use
68
- authentasaurus_tables
69
- in the migration down method
70
- authentasaurus_drop_tables
71
- </pre>
72
- </li>
73
- <li>migrate your database and setup your default data
74
-
75
- <pre>
76
- rake authentasaurus:setup_defaults
77
- </pre>
78
- </li>
79
- <li>add your routes
80
-
81
- <pre>
82
- map.authentasaurus_routes :authorizable, :validatable, :invitable
83
- </pre>
84
- </li>
85
- </ol>
86
- <p>
87
- that&#8217;s the most basic and quick setup, you can now test your
88
- application by running script/server in your project root directory and
89
- going to <a
90
- href="http://localhost:3000/sessions/sign-in">localhost:3000/sessions/sign-in</a>
91
- </p>
92
- <p>
93
- <a href="../classes/Authentasaurus.html">Authentasaurus</a> is modular, you
94
- can install modules as you need them (the previous setup contains all
95
- modules), refer to the documentation for more information.
96
- </p>
97
- <h2>Under the hood</h2>
98
- <p>
99
- <a href="../classes/Authentasaurus.html">Authentasaurus</a> takes advantage
100
- of rails&#8217; before_filter; it checks for the appropriate permissions
101
- before every action that requires a login, a write or read permission.
102
- </p>
103
- <p>
104
- At login, authentasaurus would load the user&#8217;s group permissions into
105
- a session hash and then attempts to read that hash when it meets a require
106
- helper on a controller.
107
- </p>
108
- <h3><a href="../classes/Authentasaurus.html">Authentasaurus</a> uses the following terms:</h3>
109
- <table>
110
- <tr><td valign="top"><tt>Area</tt>:</td><td>An area is in plain english the controller&#8217;s name, so if you have a
111
- controller named &#8220;PostsController&#8221;, the corresponding area name
112
- would be &#8220;posts&#8221; (just as you type it in the generator command)
113
-
114
- </td></tr>
115
- <tr><td valign="top"><tt>Group</tt>:</td><td>A group is as the name suggests, each group contains a number of users, and
116
- each user inherits the group permissions, also note that at any given time,
117
- the user can only belong to one group
118
-
119
- </td></tr>
120
- <tr><td valign="top"><tt>Permission</tt>:</td><td>A permission is one of two, either read or write, but take care, read or
121
- write is only a naming, and though it doesn&#8217;t make sense, you could
122
- treat a read permission as a write permission and vice versa, but as i said
123
- it makes no sense !
124
-
125
- </td></tr>
126
- </table>
127
- <h2>Generators</h2>
128
- <p>
129
- There are two generators in <a
130
- href="../classes/Authentasaurus.html">Authentasaurus</a>, the default
131
- generator
132
- </p>
133
- <pre>
134
- authentasaurus
135
- </pre>
136
- <p>
137
- and the views generator
138
- </p>
139
- <pre>
140
- authentasaurus_views
141
- </pre>
142
- <p>
143
- The default generator generates configurations and tasks needed by <a
144
- href="../classes/Authentasaurus.html">Authentasaurus</a>, while the views
145
- generator generates the views used by <a
146
- href="../classes/Authentasaurus.html">Authentasaurus</a> in your
147
- application, this is useful for customizing authentasaurus and is totally
148
- optional.
149
- </p>
150
- <p>
151
- <a href="../classes/Authentasaurus.html">Authentasaurus</a> views generator
152
- takes the name of the user controller, by default it&#8217;s users
153
- </p>
154
- <pre>
155
- script/generate authentasaurus_views users
156
- </pre>
157
- <p>
158
- You can also use namespaces:
159
- </p>
160
- <pre>
161
- script/generate authentasaurus_views admin/users
162
- </pre>
163
- <p>
164
- Also you can use some options with the <a
165
- href="../classes/Authentasaurus.html">Authentasaurus</a> views generator to
166
- add the modules you need:
167
- </p>
168
- <table>
169
- <tr><td valign="top"><tt>--authorizable</tt>:</td><td>generates the views necessary for authorization (groups, areas and
170
- permissions)
171
-
172
- </td></tr>
173
- <tr><td valign="top"><tt>--invitable</tt>:</td><td>generates the views necessary for invitable users
174
-
175
- </td></tr>
176
- <tr><td valign="top"><tt>--validatable</tt>:</td><td>generates the views necessary for validatable users
177
-
178
- </td></tr>
179
- </table>
180
- <p>
181
- You can use a combination of those options like the following example:
182
- </p>
183
- <pre>
184
- script/generate authentasaurus_views users --authorizable --invitable --validatable
185
- </pre>
186
- <h2>Controller Authorization Helpers</h2>
187
- <p>
188
- There are four main authorization helpers in <a
189
- href="../classes/Authentasaurus.html">Authentasaurus</a> for use on
190
- controllers:
191
- </p>
192
- <table>
193
- <tr><td valign="top"><tt>require_login</tt>:</td><td>requires the user to login before accessing the actions specified
194
-
195
- <p>
196
- <b>ex:</b> Tells <a
197
- href="../classes/Authentasaurus.html">Authentasaurus</a> that the action
198
- destroy requires login and that <a
199
- href="../classes/Authentasaurus.html">Authentasaurus</a> shouldn&#8217;t
200
- store the request in the session (typically for logout actions)
201
- </p>
202
- <ul>
203
- <li>:skip_request - skips saving the original request (to redirect to after
204
- login)
205
-
206
- </li>
207
- <li>:user_model - if defined, authentasaurus will use that model instead of the
208
- default &#8220;User&#8220;
209
-
210
- </li>
211
- <li>:if - specifies a method, proc or string to call to determine if the
212
- authorization should occur
213
-
214
- </li>
215
- <li>:unless - specifies a method, proc or string to call to determine if the
216
- authorization should not occur
217
-
218
- <p>
219
- require_login :destroy, :skip_request => true
220
- </p>
221
- </li>
222
- </ul>
223
- </td></tr>
224
- <tr><td valign="top"><tt>require_write</tt>:</td><td>requires the user to have a write permission to that area to access the
225
- actions specified
226
-
227
- <p>
228
- <b>ex:</b> Tells <a
229
- href="../classes/Authentasaurus.html">Authentasaurus</a> that the actions
230
- create_user and delete_user requires login and write permission.
231
- </p>
232
- <ul>
233
- <li>:skip_request - skips saving the original request (to redirect to after
234
- login)
235
-
236
- </li>
237
- <li>:user_model - if defined, authentasaurus will use that model instead of the
238
- default &#8220;User&#8220;
239
-
240
- </li>
241
- <li>:if - specifies a method, proc or string to call to determine if the
242
- authorization should occur
243
-
244
- </li>
245
- <li>:unless - specifies a method, proc or string to call to determine if the
246
- authorization should not occur
247
-
248
- <p>
249
- require_write :create_user, :delete_user
250
- </p>
251
- </li>
252
- </ul>
253
- </td></tr>
254
- <tr><td valign="top"><tt>require_read</tt>:</td><td>requires the user to have a read permission to that area to access the
255
- actions specified
256
-
257
- <p>
258
- <b>ex:</b> Tells <a
259
- href="../classes/Authentasaurus.html">Authentasaurus</a> that the action
260
- show_user requires login and read permission.
261
- </p>
262
- <ul>
263
- <li>:skip_request - skips saving the original request (to redirect to after
264
- login)
265
-
266
- </li>
267
- <li>:user_model - if defined, authentasaurus will use that model instead of the
268
- default &#8220;User&#8220;
269
-
270
- </li>
271
- <li>:if - specifies a method, proc or string to call to determine if the
272
- authorization should occur
273
-
274
- </li>
275
- <li>:unless - specifies a method, proc or string to call to determine if the
276
- authorization should not occur
277
-
278
- <p>
279
- require_read :show_user, :if api_key.nil?
280
- </p>
281
- </li>
282
- </ul>
283
- </td></tr>
284
- </table>
285
- <p>
286
- You can use any of those class methods on you controllers to restrict
287
- access levels like so:
288
- </p>
289
- <pre>
290
- class PostsController &lt; ApplicationController
291
- require_login :index
292
- require_read :show
293
- require_write :new, :create, :edit, :update, :destroy
294
-
295
- def index
296
- # your code here
297
- end
298
-
299
- def show
300
- # your code here
301
- end
302
-
303
- def new
304
- # your code here
305
- end
306
-
307
- def create
308
- # your code here
309
- end
310
-
311
- def edit
312
- # your code here
313
- end
314
-
315
- def update
316
- # your code here
317
- end
318
-
319
- def destroy
320
- # your code here
321
- end
322
- end
323
- </pre>
324
- <p>
325
- In addition there is also the has? helper which is available in both
326
- Controllers and Views
327
- </p>
328
- <table>
329
- <tr><td valign="top"><tt>has?(permission, area=nil)</tt>:</td><td>Checks if the current user has the appropriate permissions for the area
330
- specified
331
-
332
- <p>
333
- <b>ex</b>: has?(:write) or has?(:read, :users)
334
- </p>
335
- </td></tr>
336
- </table>
337
- <p>
338
- Copyright &#169; 2010 Mash, Ltd., released under the MIT license
339
- </p>
340
-
341
- </div>
342
-
343
-
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
- </div>
364
- </div>
365
- </body>
366
- </html>