corral_acl 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -1
  3. data/Gemfile +12 -1
  4. data/LICENSE +1 -1
  5. data/README.md +2 -2
  6. data/Rakefile +34 -0
  7. data/bin/test +9 -0
  8. data/corral.gemspec +12 -12
  9. data/lib/corral/version.rb +1 -1
  10. data/lib/tasks/corral_tasks.rake +4 -0
  11. data/test/corral_test.rb +7 -0
  12. data/test/dummy/Rakefile +6 -0
  13. data/test/dummy/app/assets/config/manifest.js +4 -0
  14. data/test/dummy/app/assets/images/.keep +0 -0
  15. data/test/dummy/app/assets/javascripts/application.js +13 -0
  16. data/test/dummy/app/assets/javascripts/cable.js +13 -0
  17. data/test/dummy/app/assets/javascripts/channels/.keep +0 -0
  18. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  19. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  20. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  21. data/test/dummy/app/controllers/application_controller.rb +3 -0
  22. data/test/dummy/app/controllers/concerns/.keep +0 -0
  23. data/test/dummy/app/helpers/application_helper.rb +2 -0
  24. data/test/dummy/app/jobs/application_job.rb +2 -0
  25. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  26. data/test/dummy/app/models/application_record.rb +3 -0
  27. data/test/dummy/app/models/concerns/.keep +0 -0
  28. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  29. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  30. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  31. data/test/dummy/bin/bundle +3 -0
  32. data/test/dummy/bin/rails +4 -0
  33. data/test/dummy/bin/rake +4 -0
  34. data/test/dummy/bin/setup +34 -0
  35. data/test/dummy/bin/update +29 -0
  36. data/test/dummy/config.ru +5 -0
  37. data/test/dummy/config/application.rb +15 -0
  38. data/test/dummy/config/boot.rb +5 -0
  39. data/test/dummy/config/cable.yml +9 -0
  40. data/test/dummy/config/database.yml +25 -0
  41. data/test/dummy/config/environment.rb +5 -0
  42. data/test/dummy/config/environments/development.rb +54 -0
  43. data/test/dummy/config/environments/production.rb +86 -0
  44. data/test/dummy/config/environments/test.rb +42 -0
  45. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  46. data/test/dummy/config/initializers/assets.rb +11 -0
  47. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  48. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  49. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/test/dummy/config/initializers/inflections.rb +16 -0
  51. data/test/dummy/config/initializers/mime_types.rb +4 -0
  52. data/test/dummy/config/initializers/new_framework_defaults.rb +24 -0
  53. data/test/dummy/config/initializers/session_store.rb +3 -0
  54. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  55. data/test/dummy/config/locales/en.yml +23 -0
  56. data/test/dummy/config/puma.rb +47 -0
  57. data/test/dummy/config/routes.rb +3 -0
  58. data/test/dummy/config/secrets.yml +22 -0
  59. data/test/dummy/config/spring.rb +6 -0
  60. data/test/dummy/lib/assets/.keep +0 -0
  61. data/test/dummy/log/.keep +0 -0
  62. data/test/dummy/public/404.html +67 -0
  63. data/test/dummy/public/422.html +67 -0
  64. data/test/dummy/public/500.html +66 -0
  65. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  66. data/test/dummy/public/apple-touch-icon.png +0 -0
  67. data/test/dummy/public/favicon.ico +0 -0
  68. data/test/test_helper.rb +20 -0
  69. metadata +90 -51
  70. data/.rspec +0 -2
  71. data/doc/Ability.html +0 -257
  72. data/doc/Corral.html +0 -131
  73. data/doc/Corral/Ability.html +0 -802
  74. data/doc/Corral/AccessDenied.html +0 -146
  75. data/doc/Corral/AuthorizationNotPerformed.html +0 -145
  76. data/doc/Corral/ControllerAdditions.html +0 -513
  77. data/doc/Corral/ControllerAdditions/ClassMethods.html +0 -277
  78. data/doc/Corral/Error.html +0 -141
  79. data/doc/Corral/Generators.html +0 -117
  80. data/doc/Corral/Generators/AbilityGenerator.html +0 -195
  81. data/doc/Corral/NullRule.html +0 -226
  82. data/doc/Corral/SubjectRule.html +0 -406
  83. data/doc/_index.html +0 -194
  84. data/doc/class_list.html +0 -51
  85. data/doc/css/common.css +0 -1
  86. data/doc/css/full_list.css +0 -58
  87. data/doc/css/style.css +0 -474
  88. data/doc/doc/_index.html +0 -87
  89. data/doc/doc/class_list.html +0 -51
  90. data/doc/doc/css/common.css +0 -1
  91. data/doc/doc/css/full_list.css +0 -58
  92. data/doc/doc/css/style.css +0 -474
  93. data/doc/doc/file_list.html +0 -51
  94. data/doc/doc/frames.html +0 -17
  95. data/doc/doc/index.html +0 -87
  96. data/doc/doc/js/app.js +0 -243
  97. data/doc/doc/js/full_list.js +0 -216
  98. data/doc/doc/js/jquery.js +0 -4
  99. data/doc/doc/method_list.html +0 -51
  100. data/doc/doc/top-level-namespace.html +0 -102
  101. data/doc/file.README.html +0 -82
  102. data/doc/file_list.html +0 -56
  103. data/doc/frames.html +0 -17
  104. data/doc/index.html +0 -82
  105. data/doc/js/app.js +0 -243
  106. data/doc/js/full_list.js +0 -216
  107. data/doc/js/jquery.js +0 -4
  108. data/doc/method_list.html +0 -211
  109. data/doc/top-level-namespace.html +0 -114
  110. data/spec/corral/ability_spec.rb +0 -26
  111. data/spec/spec_helper.rb +0 -97
@@ -1,195 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Corral::Generators::AbilityGenerator
8
-
9
- &mdash; Documentation by YARD 0.9.0
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "Corral::Generators::AbilityGenerator";
19
- relpath = '../../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../../class_list.html"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../../_index.html">Index (A)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../../Corral.html" title="Corral (module)">Corral</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Generators.html" title="Corral::Generators (module)">Generators</a></span></span>
41
- &raquo;
42
- <span class="title">AbilityGenerator</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame" src="../../class_list.html"></iframe>
63
-
64
- <div id="content"><h1>Class: Corral::Generators::AbilityGenerator
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName">Rails::Generators::Base</span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next">Rails::Generators::Base</li>
80
-
81
- <li class="next">Corral::Generators::AbilityGenerator</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
- </dl>
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <dl>
100
- <dt>Defined in:</dt>
101
- <dd>lib/generators/corral/ability/ability_generator.rb</dd>
102
- </dl>
103
-
104
- </div>
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
- <h2>
115
- Instance Method Summary
116
- <small><a href="#" class="summary_toggle">collapse</a></small>
117
- </h2>
118
-
119
- <ul class="summary">
120
-
121
- <li class="public ">
122
- <span class="summary_signature">
123
-
124
- <a href="#generate_ability-instance_method" title="#generate_ability (instance method)">#<strong>generate_ability</strong> &#x21d2; Object </a>
125
-
126
-
127
-
128
- </span>
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
- <span class="summary_desc"><div class='inline'></div></span>
139
-
140
- </li>
141
-
142
-
143
- </ul>
144
-
145
-
146
-
147
-
148
-
149
- <div id="instance_method_details" class="method_details_list">
150
- <h2>Instance Method Details</h2>
151
-
152
-
153
- <div class="method_details first">
154
- <h3 class="signature first" id="generate_ability-instance_method">
155
-
156
- #<strong>generate_ability</strong> &#x21d2; <tt>Object</tt>
157
-
158
-
159
-
160
-
161
-
162
- </h3><table class="source_code">
163
- <tr>
164
- <td>
165
- <pre class="lines">
166
-
167
-
168
- 6
169
- 7
170
- 8</pre>
171
- </td>
172
- <td>
173
- <pre class="code"><span class="info file"># File 'lib/generators/corral/ability/ability_generator.rb', line 6</span>
174
-
175
- <span class='kw'>def</span> <span class='id identifier rubyid_generate_ability'>generate_ability</span>
176
- <span class='id identifier rubyid_copy_file'>copy_file</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ability.rb</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>app/models/ability.rb</span><span class='tstring_end'>&quot;</span></span>
177
- <span class='kw'>end</span></pre>
178
- </td>
179
- </tr>
180
- </table>
181
- </div>
182
-
183
- </div>
184
-
185
- </div>
186
-
187
- <div id="footer">
188
- Generated on Wed Jul 6 11:31:38 2016 by
189
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
190
- 0.9.0 (ruby-2.3.1).
191
- </div>
192
-
193
- </div>
194
- </body>
195
- </html>
@@ -1,226 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Corral::NullRule
8
-
9
- &mdash; Documentation by YARD 0.9.0
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "Corral::NullRule";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (N)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../Corral.html" title="Corral (module)">Corral</a></span></span>
41
- &raquo;
42
- <span class="title">NullRule</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame" src="../class_list.html"></iframe>
63
-
64
- <div id="content"><h1>Class: Corral::NullRule
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName">Object</span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next">Corral::NullRule</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/corral/rule.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
- <h2>Overview</h2><div class="docstring">
105
- <div class="discussion">
106
-
107
- <p>Fake rule representing nothing matched a subject when looking up its
108
- ability.</p>
109
-
110
-
111
- </div>
112
- </div>
113
- <div class="tags">
114
-
115
-
116
- </div>
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
- <h2>
125
- Class Method Summary
126
- <small><a href="#" class="summary_toggle">collapse</a></small>
127
- </h2>
128
-
129
- <ul class="summary">
130
-
131
- <li class="public ">
132
- <span class="summary_signature">
133
-
134
- <a href="#authorized%3F-class_method" title="authorized? (class method)">.<strong>authorized?</strong> &#x21d2; Boolean </a>
135
-
136
-
137
-
138
- </span>
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
- <span class="summary_desc"><div class='inline'></div></span>
149
-
150
- </li>
151
-
152
-
153
- </ul>
154
-
155
-
156
-
157
-
158
- <div id="class_method_details" class="method_details_list">
159
- <h2>Class Method Details</h2>
160
-
161
-
162
- <div class="method_details first">
163
- <h3 class="signature first" id="authorized?-class_method">
164
-
165
- .<strong>authorized?</strong> &#x21d2; <tt>Boolean</tt>
166
-
167
-
168
-
169
-
170
-
171
- </h3><div class="docstring">
172
- <div class="discussion">
173
-
174
-
175
- </div>
176
- </div>
177
- <div class="tags">
178
-
179
- <p class="tag_title">Returns:</p>
180
- <ul class="return">
181
-
182
- <li>
183
-
184
-
185
- <span class='type'>(<tt>Boolean</tt>)</span>
186
-
187
-
188
-
189
- </li>
190
-
191
- </ul>
192
-
193
- </div><table class="source_code">
194
- <tr>
195
- <td>
196
- <pre class="lines">
197
-
198
-
199
- 26
200
- 27
201
- 28</pre>
202
- </td>
203
- <td>
204
- <pre class="code"><span class="info file"># File 'lib/corral/rule.rb', line 26</span>
205
-
206
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_authorized?'>authorized?</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
207
- <span class='kw'>false</span>
208
- <span class='kw'>end</span></pre>
209
- </td>
210
- </tr>
211
- </table>
212
- </div>
213
-
214
- </div>
215
-
216
- </div>
217
-
218
- <div id="footer">
219
- Generated on Wed Jul 6 11:22:31 2016 by
220
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
221
- 0.9.0 (ruby-2.3.1).
222
- </div>
223
-
224
- </div>
225
- </body>
226
- </html>
@@ -1,406 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Corral::SubjectRule
8
-
9
- &mdash; Documentation by YARD 0.9.0
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "Corral::SubjectRule";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (S)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../Corral.html" title="Corral (module)">Corral</a></span></span>
41
- &raquo;
42
- <span class="title">SubjectRule</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame" src="../class_list.html"></iframe>
63
-
64
- <div id="content"><h1>Class: Corral::SubjectRule
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName">Object</span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next">Corral::SubjectRule</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/corral/rule.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
- <h2>Overview</h2><div class="docstring">
105
- <div class="discussion">
106
-
107
- <p>Rule class representing actions doable on a subject.</p>
108
-
109
-
110
- </div>
111
- </div>
112
- <div class="tags">
113
-
114
-
115
- </div>
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
- <h2>
124
- Instance Method Summary
125
- <small><a href="#" class="summary_toggle">collapse</a></small>
126
- </h2>
127
-
128
- <ul class="summary">
129
-
130
- <li class="public ">
131
- <span class="summary_signature">
132
-
133
- <a href="#add_deny-instance_method" title="#add_deny (instance method)">#<strong>add_deny</strong>(action, block) &#x21d2; Object </a>
134
-
135
-
136
-
137
- </span>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- <span class="summary_desc"><div class='inline'></div></span>
148
-
149
- </li>
150
-
151
-
152
- <li class="public ">
153
- <span class="summary_signature">
154
-
155
- <a href="#add_grant-instance_method" title="#add_grant (instance method)">#<strong>add_grant</strong>(action, block) &#x21d2; Object </a>
156
-
157
-
158
-
159
- </span>
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
- <span class="summary_desc"><div class='inline'></div></span>
170
-
171
- </li>
172
-
173
-
174
- <li class="public ">
175
- <span class="summary_signature">
176
-
177
- <a href="#authorized%3F-instance_method" title="#authorized? (instance method)">#<strong>authorized?</strong>(action, subject, args) &#x21d2; Boolean </a>
178
-
179
-
180
-
181
- </span>
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
- <span class="summary_desc"><div class='inline'></div></span>
192
-
193
- </li>
194
-
195
-
196
- <li class="public ">
197
- <span class="summary_signature">
198
-
199
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; SubjectRule </a>
200
-
201
-
202
-
203
- </span>
204
-
205
-
206
- <span class="note title constructor">constructor</span>
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
- <span class="summary_desc"><div class='inline'>
216
- <p>A new instance of SubjectRule.</p>
217
- </div></span>
218
-
219
- </li>
220
-
221
-
222
- </ul>
223
-
224
-
225
- <div id="constructor_details" class="method_details_list">
226
- <h2>Constructor Details</h2>
227
-
228
- <div class="method_details first">
229
- <h3 class="signature first" id="initialize-instance_method">
230
-
231
- #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Corral::SubjectRule (class)">SubjectRule</a></span></tt>
232
-
233
-
234
-
235
-
236
-
237
- </h3><div class="docstring">
238
- <div class="discussion">
239
-
240
- <p>Returns a new instance of SubjectRule</p>
241
-
242
-
243
- </div>
244
- </div>
245
- <div class="tags">
246
-
247
-
248
- </div><table class="source_code">
249
- <tr>
250
- <td>
251
- <pre class="lines">
252
-
253
-
254
- 4
255
- 5
256
- 6</pre>
257
- </td>
258
- <td>
259
- <pre class="code"><span class="info file"># File 'lib/corral/rule.rb', line 4</span>
260
-
261
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
262
- <span class='ivar'>@actions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
263
- <span class='kw'>end</span></pre>
264
- </td>
265
- </tr>
266
- </table>
267
- </div>
268
-
269
- </div>
270
-
271
-
272
- <div id="instance_method_details" class="method_details_list">
273
- <h2>Instance Method Details</h2>
274
-
275
-
276
- <div class="method_details first">
277
- <h3 class="signature first" id="add_deny-instance_method">
278
-
279
- #<strong>add_deny</strong>(action, block) &#x21d2; <tt>Object</tt>
280
-
281
-
282
-
283
-
284
-
285
- </h3><table class="source_code">
286
- <tr>
287
- <td>
288
- <pre class="lines">
289
-
290
-
291
- 12
292
- 13
293
- 14</pre>
294
- </td>
295
- <td>
296
- <pre class="code"><span class="info file"># File 'lib/corral/rule.rb', line 12</span>
297
-
298
- <span class='kw'>def</span> <span class='id identifier rubyid_add_deny'>add_deny</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
299
- <span class='ivar'>@actions</span><span class='lbracket'>[</span><span class='id identifier rubyid_action'>action</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span> <span class='op'>||</span> <span class='kw'>false</span><span class='rparen'>)</span>
300
- <span class='kw'>end</span></pre>
301
- </td>
302
- </tr>
303
- </table>
304
- </div>
305
-
306
- <div class="method_details ">
307
- <h3 class="signature " id="add_grant-instance_method">
308
-
309
- #<strong>add_grant</strong>(action, block) &#x21d2; <tt>Object</tt>
310
-
311
-
312
-
313
-
314
-
315
- </h3><table class="source_code">
316
- <tr>
317
- <td>
318
- <pre class="lines">
319
-
320
-
321
- 8
322
- 9
323
- 10</pre>
324
- </td>
325
- <td>
326
- <pre class="code"><span class="info file"># File 'lib/corral/rule.rb', line 8</span>
327
-
328
- <span class='kw'>def</span> <span class='id identifier rubyid_add_grant'>add_grant</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
329
- <span class='ivar'>@actions</span><span class='lbracket'>[</span><span class='id identifier rubyid_action'>action</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span> <span class='op'>||</span> <span class='kw'>true</span><span class='rparen'>)</span>
330
- <span class='kw'>end</span></pre>
331
- </td>
332
- </tr>
333
- </table>
334
- </div>
335
-
336
- <div class="method_details ">
337
- <h3 class="signature " id="authorized?-instance_method">
338
-
339
- #<strong>authorized?</strong>(action, subject, args) &#x21d2; <tt>Boolean</tt>
340
-
341
-
342
-
343
-
344
-
345
- </h3><div class="docstring">
346
- <div class="discussion">
347
-
348
-
349
- </div>
350
- </div>
351
- <div class="tags">
352
-
353
- <p class="tag_title">Returns:</p>
354
- <ul class="return">
355
-
356
- <li>
357
-
358
-
359
- <span class='type'>(<tt>Boolean</tt>)</span>
360
-
361
-
362
-
363
- </li>
364
-
365
- </ul>
366
-
367
- </div><table class="source_code">
368
- <tr>
369
- <td>
370
- <pre class="lines">
371
-
372
-
373
- 16
374
- 17
375
- 18
376
- 19
377
- 20
378
- 21</pre>
379
- </td>
380
- <td>
381
- <pre class="code"><span class="info file"># File 'lib/corral/rule.rb', line 16</span>
382
-
383
- <span class='kw'>def</span> <span class='id identifier rubyid_authorized?'>authorized?</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='comma'>,</span> <span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
384
- <span class='id identifier rubyid_block'>block</span> <span class='op'>=</span> <span class='ivar'>@actions</span><span class='lbracket'>[</span><span class='symbol'>:manage</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='ivar'>@actions</span><span class='lbracket'>[</span><span class='id identifier rubyid_action'>action</span><span class='rbracket'>]</span>
385
- <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
386
- <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>==</span> <span class='kw'>true</span>
387
- <span class='kw'>return</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='lbracket'>[</span><span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rbracket'>]</span><span class='rparen'>)</span>
388
- <span class='kw'>end</span></pre>
389
- </td>
390
- </tr>
391
- </table>
392
- </div>
393
-
394
- </div>
395
-
396
- </div>
397
-
398
- <div id="footer">
399
- Generated on Wed Jul 6 11:22:31 2016 by
400
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
401
- 0.9.0 (ruby-2.3.1).
402
- </div>
403
-
404
- </div>
405
- </body>
406
- </html>