The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

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

DESCRIPTION

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

METHODS

add_acl ( implemented in Net::Google::DocumentsList::Item object )

adds new ACL to document or folder.

$doc->add_acl(
  {
      role => 'reader',
      scope => {
          type => 'user',
          value => 'foo.bar@gmail.com',
      }
  }
);

delete

delete the acl from attached document or folder.

ATTRIBUTES

role

scope

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.

AUTHOR

Noubo Danjou <nobuo.danjou@gmail.com>

SEE ALSO

XML::Atom

Net::Google::AuthSub

Net::Google::DataAPI

Net::Google::DocumentsList::Role::HasItems

http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html

LICENSE

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