2012-05-11 1 views
0

Google 데이터 .NET 라이브러리를 사용하고 있습니다. 폴더 ID (예 : 사용자가 브라우저에서 복사하여 붙여 넣을 수있는 폴더)의 URL을 감안할 때 해당 폴더에 대한 액세스 제어 목록을 가져 와서 변경 작업을 수행 할 수 있기를 원합니다.Google 문서 도구 API를 사용하여 URL 만있는 폴더의 ACL 가져 오기

 DocumentsService ss = new DocumentsService(appname); 
     ss.setUserCredentials(username, password); 

     FolderQuery fq = new FolderQuery(folderid); 
     DocumentsFeed df = ss.Query(fq); 

     DocumentEntry de = (DocumentEntry)df.Entries[0]; 
     Uri AclUri = new Uri(de.AccessControlList); 

을하지만 그것은 단지 폴더의 내용을 반환

나는이 같은 FolderQuery 사용할 수 있습니다. 나는 그 폴더 자체를 원한다.

제안 사항?

감사합니다.

답변

0

FolderQuery 클래스는 폴더의 내용을 검색하는 데 사용되지만 문서의 경우처럼 폴더의 액세스 제어 목록을 검색 할 수 있습니다.

DocumentsService ss = new DocumentsService(appname); 
ss.setUserCredentials(username, password); 

string uri = String.Format(DocumentsListQuery.aclsUriTemplate, folderId); 
AclQuery query = new AclQuery(uri); 
AclFeed feed = ss.Query(query); 

foreach (AclEntry acl in feed.Entries) 
{ 
    // Print the acl Role to the screen 
    Console.WriteLine(acl.Role.Value); 
    // Print the acl Scope type and value to the screen 
    Console.WriteLine(acl.Scope.Type + " - " + acl.Scope.Value); 
} 
: 다음 코드는 folderId 가정

는 당신이 ACL을 검색 할 폴더의 ID입니다