s33r 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/cli/simple.rb +17 -0
- data/examples/fores33r/app/controllers/browser_controller.rb +32 -8
- data/examples/fores33r/app/views/browser/_create_bucket.rhtml +6 -0
- data/examples/fores33r/app/views/browser/_upload.rhtml +5 -0
- data/examples/fores33r/app/views/browser/index.rhtml +1 -8
- data/examples/fores33r/app/views/browser/plain_bucket.rhtml +3 -0
- data/examples/fores33r/app/views/browser/s3_index.rhtml +9 -0
- data/examples/fores33r/app/views/browser/show_bucket.rhtml +6 -8
- data/examples/fores33r/app/views/layouts/application.rhtml +2 -0
- data/examples/fores33r/app/views/layouts/s3_layout.rhtml +14 -0
- data/examples/fores33r/config/environment.rb +1 -1
- data/examples/fores33r/config/routes.rb +2 -0
- data/examples/fores33r/public/stylesheets/core.css +2 -2
- data/html/classes/Net/HTTPResponse.html +3 -0
- data/html/classes/S33r.html +127 -116
- data/html/classes/S33r/BucketListing.html +119 -94
- data/html/classes/S33r/Client.html +602 -536
- data/html/classes/S33r/LoggingResource.html +3 -3
- data/html/classes/S33r/NamedBucket.html +235 -191
- data/html/classes/S33r/OrderlyXmlMarkup.html +7 -7
- data/html/classes/S33r/S33rException.html +1 -0
- data/html/classes/S33r/S33rException/TryingToPutEmptyResource.html +117 -0
- data/html/classes/S33r/S3ACL/ACLDoc.html +94 -94
- data/html/classes/S33r/S3ACL/AmazonCustomer.html +5 -5
- data/html/classes/S33r/S3ACL/CanonicalUser.html +12 -12
- data/html/classes/S33r/S3ACL/Grant.html +64 -64
- data/html/classes/S33r/S3ACL/Grantee.html +36 -36
- data/html/classes/S33r/S3ACL/Group.html +8 -8
- data/html/classes/S33r/S3Object.html +387 -79
- data/html/classes/XML.html +15 -15
- data/html/created.rid +1 -1
- data/html/files/CHANGELOG.html +7 -1
- data/html/files/MIT-LICENSE.html +1 -1
- data/html/files/README_txt.html +3 -7
- data/html/files/lib/s33r/bucket_listing_rb.html +1 -9
- data/html/files/lib/s33r/builder_rb.html +1 -1
- data/html/files/lib/s33r/client_rb.html +1 -1
- data/html/files/lib/s33r/core_rb.html +1 -2
- data/html/files/lib/s33r/libxml_extensions_rb.html +1 -7
- data/html/files/lib/s33r/libxml_loader_rb.html +109 -0
- data/html/files/lib/s33r/logging_rb.html +1 -2
- data/html/files/lib/s33r/mimetypes_rb.html +1 -1
- data/html/files/lib/s33r/named_bucket_rb.html +1 -1
- data/html/files/lib/s33r/s33r_exception_rb.html +1 -1
- data/html/files/lib/s33r/s33r_http_rb.html +1 -1
- data/html/files/lib/s33r/s3_acl_rb.html +1 -2
- data/html/files/lib/s33r/s3_obj_rb.html +108 -0
- data/html/files/lib/s33r/sync_rb.html +1 -1
- data/html/files/lib/s33r_rb.html +1 -1
- data/html/fr_class_index.html +1 -0
- data/html/fr_file_index.html +2 -0
- data/html/fr_method_index.html +80 -71
- data/lib/s33r/bucket_listing.rb +30 -55
- data/lib/s33r/client.rb +70 -28
- data/lib/s33r/core.rb +9 -4
- data/lib/s33r/libxml_extensions.rb +2 -0
- data/lib/s33r/libxml_loader.rb +6 -0
- data/lib/s33r/logging.rb +3 -3
- data/lib/s33r/named_bucket.rb +33 -15
- data/lib/s33r/s33r_exception.rb +4 -0
- data/lib/s33r/s33r_http.rb +1 -1
- data/lib/s33r/s3_acl.rb +3 -2
- data/lib/s33r/s3_obj.rb +186 -0
- data/test/cases/spec_bucket_listing.rb +9 -33
- data/test/cases/spec_s3_object.rb +35 -0
- data/test/files/suspect_bucket_listing.xml +19 -0
- metadata +94 -89
- data/examples/fores33r/log/development.log +0 -5960
- data/examples/fores33r/log/production.log +0 -0
- data/examples/fores33r/log/server.log +0 -0
- data/examples/fores33r/log/test.log +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.2ea325f604aa5fb9 +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.39d37e054d21d545 +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.acf71fc73aa74983 +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.c1697b7d6670f3cd +0 -0
@@ -92,7 +92,7 @@ Variant of XmlMarkup which explicitly orders attributes.
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
95
|
+
<a href="#M000157">_insert_attributes</a>
|
96
96
|
</div>
|
97
97
|
</div>
|
98
98
|
|
@@ -114,11 +114,11 @@ Variant of XmlMarkup which explicitly orders attributes.
|
|
114
114
|
<div id="methods">
|
115
115
|
<h3 class="section-bar">Public Instance methods</h3>
|
116
116
|
|
117
|
-
<div id="method-
|
118
|
-
<a name="
|
117
|
+
<div id="method-M000157" class="method-detail">
|
118
|
+
<a name="M000157"></a>
|
119
119
|
|
120
120
|
<div class="method-heading">
|
121
|
-
<a href="#
|
121
|
+
<a href="#M000157" class="method-signature">
|
122
122
|
<span class="method-name">_insert_attributes</span><span class="method-args">(attrs, order=[])</span>
|
123
123
|
</a>
|
124
124
|
</div>
|
@@ -126,12 +126,12 @@ Variant of XmlMarkup which explicitly orders attributes.
|
|
126
126
|
<div class="method-description">
|
127
127
|
<p>
|
128
128
|
Override Builder <a
|
129
|
-
href="OrderlyXmlMarkup.html#
|
129
|
+
href="OrderlyXmlMarkup.html#M000157">_insert_attributes</a> so attributes
|
130
130
|
are ordered.
|
131
131
|
</p>
|
132
132
|
<p><a class="source-toggle" href="#"
|
133
|
-
onclick="toggleCode('
|
134
|
-
<div class="method-source-code" id="
|
133
|
+
onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
|
134
|
+
<div class="method-source-code" id="M000157-source">
|
135
135
|
<pre>
|
136
136
|
<span class="ruby-comment cmt"># File lib/s33r/builder.rb, line 8</span>
|
137
137
|
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_insert_attributes</span>(<span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">order</span>=[])
|
@@ -98,6 +98,7 @@ Class <a href="S33rException/MissingBucketName.html" class="link">S33r::S33rExce
|
|
98
98
|
Class <a href="S33rException/MissingRequiredHeaders.html" class="link">S33r::S33rException::MissingRequiredHeaders</a><br />
|
99
99
|
Class <a href="S33rException/MissingResource.html" class="link">S33r::S33rException::MissingResource</a><br />
|
100
100
|
Class <a href="S33rException/S3FallenOver.html" class="link">S33r::S33rException::S3FallenOver</a><br />
|
101
|
+
Class <a href="S33rException/TryingToPutEmptyResource.html" class="link">S33r::S33rException::TryingToPutEmptyResource</a><br />
|
101
102
|
Class <a href="S33rException/UnsupportedCannedACL.html" class="link">S33r::S33rException::UnsupportedCannedACL</a><br />
|
102
103
|
Class <a href="S33rException/UnsupportedHTTPMethod.html" class="link">S33r::S33rException::UnsupportedHTTPMethod</a><br />
|
103
104
|
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: S33r::S33rException::TryingToPutEmptyResource</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">S33r::S33rException::TryingToPutEmptyResource</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/s33r/s33r_exception_rb.html">
|
59
|
+
lib/s33r/s33r_exception.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Exception
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Raised if you try to do a put with empty body
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<!-- if includes -->
|
96
|
+
|
97
|
+
<div id="section">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if method_list -->
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<div id="validator-badges">
|
113
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -179,27 +179,27 @@ Returns nil if the ACL <a href="../../XML.html">XML</a> is nil.
|
|
179
179
|
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
180
180
|
<div class="method-source-code" id="M000065-source">
|
181
181
|
<pre>
|
182
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
182
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 35</span>
|
183
|
+
35: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">acl_xml</span>)
|
184
|
+
36: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">acl_xml</span>.<span class="ruby-identifier">nil?</span>
|
185
|
+
37:
|
186
|
+
38: <span class="ruby-identifier">acl_xml</span> = <span class="ruby-constant">S33r</span>.<span class="ruby-identifier">remove_namespace</span>(<span class="ruby-identifier">acl_xml</span>)
|
187
|
+
39: <span class="ruby-identifier">doc</span> = <span class="ruby-constant">XML</span>.<span class="ruby-identifier">get_xml_doc</span>(<span class="ruby-identifier">acl_xml</span>)
|
188
|
+
40:
|
189
|
+
41: <span class="ruby-identifier">owner_xml</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">'//Owner'</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">first</span>
|
190
|
+
42: <span class="ruby-identifier">owner</span> = <span class="ruby-constant">CanonicalUser</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">owner_xml</span>)
|
191
|
+
43:
|
192
|
+
44: <span class="ruby-identifier">grants</span> = []
|
193
|
+
45: <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">'//AccessControlList/Grant'</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span>
|
194
|
+
46: <span class="ruby-identifier">grantee_xml</span> = <span class="ruby-identifier">g</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">'Grantee'</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">first</span>
|
195
|
+
47: <span class="ruby-identifier">grantee</span> = <span class="ruby-constant">Grantee</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">grantee_xml</span>)
|
196
|
+
48: <span class="ruby-identifier">permission</span> = <span class="ruby-identifier">g</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'Permission'</span>)
|
197
|
+
49:
|
198
|
+
50: <span class="ruby-identifier">grants</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Grant</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">grantee</span>, <span class="ruby-identifier">permission</span>)
|
199
|
+
51: <span class="ruby-keyword kw">end</span>
|
200
|
+
52:
|
201
|
+
53: <span class="ruby-constant">ACLDoc</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">owner</span>, <span class="ruby-identifier">grants</span>)
|
202
|
+
54: <span class="ruby-keyword kw">end</span>
|
203
203
|
</pre>
|
204
204
|
</div>
|
205
205
|
</div>
|
@@ -223,11 +223,11 @@ instance
|
|
223
223
|
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
224
224
|
<div class="method-source-code" id="M000064-source">
|
225
225
|
<pre>
|
226
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
226
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 25</span>
|
227
|
+
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner</span>, <span class="ruby-identifier">grants</span>=[])
|
228
|
+
26: <span class="ruby-ivar">@grants</span> = <span class="ruby-identifier">grants</span>
|
229
|
+
27: <span class="ruby-ivar">@owner</span> = <span class="ruby-identifier">owner</span>
|
230
|
+
28: <span class="ruby-keyword kw">end</span>
|
231
231
|
</pre>
|
232
232
|
</div>
|
233
233
|
</div>
|
@@ -255,15 +255,15 @@ Returns true if grant was added; false otherwise (grant already exists).
|
|
255
255
|
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
256
256
|
<div class="method-source-code" id="M000067-source">
|
257
257
|
<pre>
|
258
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
258
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 83</span>
|
259
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_grant</span>(<span class="ruby-identifier">grant</span>)
|
260
|
+
84: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@grants</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">grant</span>)
|
261
|
+
85: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
262
|
+
86: <span class="ruby-keyword kw">else</span>
|
263
|
+
87: <span class="ruby-ivar">@grants</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">grant</span>
|
264
|
+
88: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
265
|
+
89: <span class="ruby-keyword kw">end</span>
|
266
|
+
90: <span class="ruby-keyword kw">end</span>
|
267
267
|
</pre>
|
268
268
|
</div>
|
269
269
|
</div>
|
@@ -290,15 +290,15 @@ Returns true if grants added, false otherwise (if already a log target).
|
|
290
290
|
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
291
291
|
<div class="method-source-code" id="M000072-source">
|
292
292
|
<pre>
|
293
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
293
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 133</span>
|
294
|
+
133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_log_target_grants</span>
|
295
|
+
134: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">log_targetable?</span>
|
296
|
+
135: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
297
|
+
136: <span class="ruby-keyword kw">else</span>
|
298
|
+
137: <span class="ruby-constant">Grant</span>.<span class="ruby-identifier">log_target_grants</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-identifier">add_grant</span>(<span class="ruby-identifier">g</span>) }
|
299
|
+
138: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
300
|
+
139: <span class="ruby-keyword kw">end</span>
|
301
|
+
140: <span class="ruby-keyword kw">end</span>
|
302
302
|
</pre>
|
303
303
|
</div>
|
304
304
|
</div>
|
@@ -321,10 +321,10 @@ Add a public READ permission to this instance.
|
|
321
321
|
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
322
322
|
<div class="method-source-code" id="M000070-source">
|
323
323
|
<pre>
|
324
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
325
|
-
|
326
|
-
|
327
|
-
|
324
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 116</span>
|
325
|
+
116: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_public_read_grant</span>
|
326
|
+
117: <span class="ruby-identifier">add_grant</span>(<span class="ruby-constant">Grant</span>.<span class="ruby-identifier">public_read_grant</span>)
|
327
|
+
118: <span class="ruby-keyword kw">end</span>
|
328
328
|
</pre>
|
329
329
|
</div>
|
330
330
|
</div>
|
@@ -347,12 +347,12 @@ Does the ACL make the associated resource available as a log target?
|
|
347
347
|
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
348
348
|
<div class="method-source-code" id="M000071-source">
|
349
349
|
<pre>
|
350
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
350
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 121</span>
|
351
|
+
121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_targetable?</span>
|
352
|
+
122: <span class="ruby-identifier">log_target_grants</span> = <span class="ruby-constant">Grant</span>.<span class="ruby-identifier">log_target_grants</span>
|
353
|
+
123: <span class="ruby-identifier">log_target_grants</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">grants</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">g</span>) }
|
354
|
+
124: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
355
|
+
125: <span class="ruby-keyword kw">end</span>
|
356
356
|
</pre>
|
357
357
|
</div>
|
358
358
|
</div>
|
@@ -376,14 +376,14 @@ href="Grant.html">Grant</a> object for :all_users with :read permission)
|
|
376
376
|
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
377
377
|
<div class="method-source-code" id="M000069-source">
|
378
378
|
<pre>
|
379
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
379
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 107</span>
|
380
|
+
107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">public_readable?</span>
|
381
|
+
108: <span class="ruby-identifier">pr_grant</span> = <span class="ruby-constant">Grant</span>.<span class="ruby-identifier">public_read_grant</span>
|
382
|
+
109: <span class="ruby-identifier">grants</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span>
|
383
|
+
110: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pr_grant</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">g</span>
|
384
|
+
111: <span class="ruby-keyword kw">end</span>
|
385
|
+
112: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
386
|
+
113: <span class="ruby-keyword kw">end</span>
|
387
387
|
</pre>
|
388
388
|
</div>
|
389
389
|
</div>
|
@@ -417,10 +417,10 @@ document.
|
|
417
417
|
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
418
418
|
<div class="method-source-code" id="M000068-source">
|
419
419
|
<pre>
|
420
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
421
|
-
|
422
|
-
|
423
|
-
|
420
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 101</span>
|
421
|
+
101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_grant</span>(<span class="ruby-identifier">grant</span>)
|
422
|
+
102: <span class="ruby-ivar">@grants</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-identifier">grant</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">g</span> }
|
423
|
+
103: <span class="ruby-keyword kw">end</span>
|
424
424
|
</pre>
|
425
425
|
</div>
|
426
426
|
</div>
|
@@ -451,12 +451,12 @@ to check whether a bucket can be used as a log target.
|
|
451
451
|
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
452
452
|
<div class="method-source-code" id="M000073-source">
|
453
453
|
<pre>
|
454
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
454
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 150</span>
|
455
|
+
150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_log_target_grants</span>
|
456
|
+
151: <span class="ruby-identifier">ok</span> = <span class="ruby-keyword kw">true</span>
|
457
|
+
152: <span class="ruby-constant">Grant</span>.<span class="ruby-identifier">log_target_grants</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ok</span> = <span class="ruby-identifier">ok</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">remove_grant</span>(<span class="ruby-identifier">g</span>) }
|
458
|
+
153: <span class="ruby-identifier">ok</span>
|
459
|
+
154: <span class="ruby-keyword kw">end</span>
|
460
460
|
</pre>
|
461
461
|
</div>
|
462
462
|
</div>
|
@@ -479,28 +479,28 @@ Generate AccessControlPolicy <a href="../../XML.html">XML</a> document.
|
|
479
479
|
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
480
480
|
<div class="method-source-code" id="M000066-source">
|
481
481
|
<pre>
|
482
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
482
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 57</span>
|
483
|
+
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_xml</span>
|
484
|
+
58: <span class="ruby-identifier">xml_str</span> = <span class="ruby-value str">""</span>
|
485
|
+
59: <span class="ruby-identifier">xml</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:target</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">xml_str</span>, <span class="ruby-identifier">:indent</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>)
|
486
|
+
60:
|
487
|
+
61: <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">instruct!</span>
|
488
|
+
62:
|
489
|
+
63: <span class="ruby-comment cmt"># Access control policy XML.</span>
|
490
|
+
64: <span class="ruby-identifier">xml</span>.<span class="ruby-constant">AccessControlPolicy</span>({<span class="ruby-value str">"xmlns"</span> =<span class="ruby-operator">></span> <span class="ruby-constant">RESPONSE_NAMESPACE_URI</span>}) {
|
491
|
+
65: <span class="ruby-identifier">xml</span>.<span class="ruby-constant">Owner</span> {
|
492
|
+
66: <span class="ruby-identifier">xml</span>.<span class="ruby-constant">ID</span> <span class="ruby-identifier">owner</span>.<span class="ruby-identifier">user_id</span>
|
493
|
+
67: <span class="ruby-identifier">xml</span>.<span class="ruby-constant">DisplayName</span> <span class="ruby-identifier">owner</span>.<span class="ruby-identifier">display_name</span>
|
494
|
+
68: }
|
495
|
+
69: <span class="ruby-identifier">xml</span>.<span class="ruby-constant">AccessControlList</span> {
|
496
|
+
70: <span class="ruby-identifier">grants</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">grant</span><span class="ruby-operator">|</span>
|
497
|
+
71: <span class="ruby-identifier">xml</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">grant</span>.<span class="ruby-identifier">to_xml</span>
|
498
|
+
72: <span class="ruby-keyword kw">end</span>
|
499
|
+
73: }
|
500
|
+
74: }
|
501
|
+
75:
|
502
|
+
76: <span class="ruby-identifier">xml_str</span>
|
503
|
+
77: <span class="ruby-keyword kw">end</span>
|
504
504
|
</pre>
|
505
505
|
</div>
|
506
506
|
</div>
|
@@ -143,11 +143,11 @@ An Amazon customer for the purposes of assigning permissions.
|
|
143
143
|
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
144
144
|
<div class="method-source-code" id="M000063-source">
|
145
145
|
<pre>
|
146
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
146
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 290</span>
|
147
|
+
290: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">email_address</span>)
|
148
|
+
291: <span class="ruby-ivar">@grantee_type</span> = <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:amazon_customer</span>]
|
149
|
+
292: <span class="ruby-ivar">@email_address</span> = <span class="ruby-identifier">email_address</span>
|
150
|
+
293: <span class="ruby-keyword kw">end</span>
|
151
151
|
</pre>
|
152
152
|
</div>
|
153
153
|
</div>
|
@@ -154,12 +154,12 @@ represent users this way.)
|
|
154
154
|
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
155
155
|
<div class="method-source-code" id="M000062-source">
|
156
156
|
<pre>
|
157
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
157
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 313</span>
|
158
|
+
313: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">user_xml_doc</span>)
|
159
|
+
314: <span class="ruby-identifier">user_id</span> = <span class="ruby-identifier">user_xml_doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'ID'</span>)
|
160
|
+
315: <span class="ruby-identifier">display_name</span> = <span class="ruby-identifier">user_xml_doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'DisplayName'</span>)
|
161
|
+
316: <span class="ruby-identifier">new</span>(<span class="ruby-identifier">user_id</span>, <span class="ruby-identifier">display_name</span>)
|
162
|
+
317: <span class="ruby-keyword kw">end</span>
|
163
163
|
</pre>
|
164
164
|
</div>
|
165
165
|
</div>
|
@@ -186,12 +186,12 @@ or an ACL <<a href="Grantee.html">Grantee</a>> element.
|
|
186
186
|
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
187
187
|
<div class="method-source-code" id="M000061-source">
|
188
188
|
<pre>
|
189
|
-
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
189
|
+
<span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 304</span>
|
190
|
+
304: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">user_id</span>, <span class="ruby-identifier">display_name</span>)
|
191
|
+
305: <span class="ruby-ivar">@grantee_type</span> = <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:canonical_user</span>]
|
192
|
+
306: <span class="ruby-ivar">@user_id</span> = <span class="ruby-identifier">user_id</span>
|
193
|
+
307: <span class="ruby-ivar">@display_name</span> = <span class="ruby-identifier">display_name</span>
|
194
|
+
308: <span class="ruby-keyword kw">end</span>
|
195
195
|
</pre>
|
196
196
|
</div>
|
197
197
|
</div>
|