An entry of an ACL (access control list) of a spreadsheet.
Use GoogleSpreadsheet::Acl#[] to get GoogleSpreadsheet::AclEntry object.
This code is based on github.com/guyboertje/gdata-spreadsheet-ruby .
Edit URL of the entry.
E-tag of the entry.
The role given to the scope. One of:
“owner”: The owner.
“writer”: With read/write access.
“reader”: With read-only access.
The scope. See scope_type.
Type of the scope. One of:
“user”: scope is a user’s email address.
“group”: scope is a Google Group email address.
“domain”: scope is a Google Apps domain.
“default”: Publicly shared with all users. scope is nil
.
Title of the entry.
params
is a Hash object with keys :scope_type
,
:scope
and :role
. See #scope_type and role for
the document of the fields.
# File lib/google_spreadsheet/acl_entry.rb, line 24 def initialize(params) @params = {:role => "reader"} for name, value in params if !PARAM_NAMES.include?(name) raise(ArgumentError, "Invalid key: %p" % name) end @params[name] = value end end
# File lib/google_spreadsheet/acl_entry.rb, line 50 def inspect return "\#<%p scope_type=%p, scope=%p, role=%p>" % [self.class, @params[:scope_type], @params[:scope], @params[:role]] end
Changes the role of the scope.
e.g.
spreadsheet.acl[1].role = "writer"
# File lib/google_spreadsheet/acl_entry.rb, line 46 def role=(role) @params[:acl].update_role(self, role) end