
Net::Google::DocumentsList::ACL - Access Control List object for Google Documents List Data API

use Net::Google::DocumentsList;
my $client = Net::Google::DocumentsList->new(
username => 'myname@gmail.com',
password => 'p4$$w0rd'
);
# taking one document
my $doc = $client->item;
# getting acls
my @acls = $doc->acls;
for my $acl (@acls) {
# checking acl
if (
$acl->role eq 'writer'
&& $acl->scope->{type} eq 'user'
&& $acl->scope->{value} eq 'foo.bar@gmail.com'
) {
# updating acl
$acl->role('reader');
$acl->scope(
{
type => 'user',
value => 'someone.else@gmail.com',
}
);
# deleting acl
$acl->delete;
}
}
# adding acl
$doc->add_acl(
{
role => 'reader',
scope => {
type => 'user',
value => 'foo.bar@gmail.com',
}
}
);
# adding acl with authorization keys
# users who knows the key can write the doc
my $acl = $doc->add_acl(
{
role => 'writer',
scope => {
type => 'default',
},
withKey => 1,
}
);
say $acl->withKey; # this will show the key, and google (not you) makes the key

This module represents Access Control List object for Google Documents List Data API.

adds new ACL to document or folder.
$doc->add_acl(
{
role => 'reader',
scope => {
type => 'user',
value => 'foo.bar@gmail.com',
}
}
);
delete the acl from attached document or folder.

hashref having 'type' and 'value' keys.
see http://code.google.com/intl/en/apis/documents/docs/3.0/developers_guide_protocol.html#AccessControlLists for details.

Noubo Danjou <nobuo.danjou@gmail.com>

Net::Google::DocumentsList::Role::HasItems
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.