Dhruti90 / google-gdata1111

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Cannot retrieve Document ACLs. #305

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

When I try to get a document's ACL using the DocumentsService and ACLQuery, 
the resulting feed yields an empty AclEntry Collection using the latest 
release.

I did troubleshooting, and was able to modify the documentsService to fill 
the AclFeed with AclEntries, but the AclScope and AclRole properties are 
still not populating.  Maybe you guys can help..

In the documentsService class I added an "If" statement to the OnNewFeed 
Sub, similiar to what's in the CalendarService.  I changed it to read:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

protected void OnNewFeed(object sender, ServiceEventArgs e)
        {
            Tracing.TraceMsg("Created new Documents Feed");
            if (e == null)
            {
                throw new ArgumentNullException("e"); 
            }
            else if (e.Uri.AbsoluteUri.IndexOf("/acl") != -1)
            {
                e.Feed = new AclFeed(e.Uri, e.Service);
            }
            else
            {
            e.Feed = new DocumentsFeed(e.Uri, e.Service);
            }
        }

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

This change allows the population of entries, but leaves the Scope and Role 
properties empty.  Can't figure out how to fix it.

Original issue reported on code.google.com by edwin.la...@gmail.com on 11 Dec 2009 at 6:23

GoogleCodeExporter commented 9 years ago
Good news!  If you make the code change above, the Acl issue will be fixed.  I 
must 
have made a change to another part of the code that prevented the role and 
scope from 
populating.  I checked out the code again today fresh, and when I made the 
change 
above it now works.

Please note that we still have the problem with pdfs.  I get a 401 unauthorized 
error 
when I try to get the Acl of a pdf, just like when I try to download them.  I'm 
nearly certain that this is a request scope issue.

Original comment by edwin.la...@gmail.com on 11 Dec 2009 at 7:15

GoogleCodeExporter commented 9 years ago
I just checked in very similiar changes, and a little cover class into the ACL
assembly. This allows you to write code like this:

http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/unittes
ts/documentslive.cs#275

Original comment by fman...@gmail.com on 14 Dec 2009 at 12:19