Module: Aliyun::OSS::ACL::Bucket
- Defined in:
- lib/aliyun/oss/acl.rb
Overview
The ACL::Policy class lets you inspect and modify access controls for buckets and objects. A policy is made up of one or more Grants which specify a permission and a Grantee to whom that permission is granted.
Buckets and objects are given a default access policy which contains one grant permitting the owner of the bucket or object FULL_CONTROL over its contents. This means they can read the object, write to the object, as well as read and write its policy.
The acl
method for both buckets and objects returns the policy object for that entity:
grant = Bucket.acl('some-bucket')
grant = Bucket.acl('some-bucket', :public_read)
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(klass) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#acl(reload = false) ⇒ Object
The acl method returns and updates the acl for a given bucket.
Class Method Details
.included(klass) ⇒ Object
:nodoc:
42 43 44 |
# File 'lib/aliyun/oss/acl.rb', line 42 def self.included(klass) #:nodoc: klass.extend(ClassMethods) end |
Instance Method Details
#acl(reload = false) ⇒ Object
The acl method returns and updates the acl for a given bucket.
# Fetch a bucket
bucket = Bucket.find 'marcel'
# view
bucket.acl
# write
bucket.acl(:public_read)
78 79 80 81 82 |
# File 'lib/aliyun/oss/acl.rb', line 78 def acl(reload = false) expirable_memoize(reload) do self.class.acl(name, reload) end end |