2013-01-06 1 views
1

나는 다음 코드를 인증했다 :웹 서비스 OAuth 자격 증명으로 files.insert를 사용하여 만든 파일에 대한 사용 권한을 설정하는 방법은 무엇입니까?

key = Google::APIClient::KeyUtils.load_from_pkcs12(path_to_key_file, 'notasecret') 
    @client.authorization = Signet::OAuth2::Client.new(
     :token_credential_uri => 'https://accounts.google.com/o/oauth2/token', 
     :audience => 'https://accounts.google.com/o/oauth2/token', 
     :scope => 'https://www.googleapis.com/auth/drive', 
     :issuer => '[email protected]', 
     :signing_key => key) 

    @client.authorization.fetch_access_token! 

및 문서가 성공적으로 생성

file = @drive.files.insert.request_schema.new({ 
    'title' => title, 
    'description' => description, 
    'mimeType' => mime_type 
}) 
media = Google::APIClient::UploadIO.new(file_name, mime_type) 
result = @client.execute(
    :api_method => @drive.files.insert, 
    :body_object => file, 
    :media => media, 
    :parameters => { 
    'uploadType' => 'multipart', 
    'convert' => true, 
    'alt' => 'json'}) 

사용하여 파일을 생성,하지만 난에 결과 파일의 소유권을 설정하는 방법을 알아낼 수 없습니다 내 도메인 내의 특정 사용자 (또는 소유권 설정이 불가능할 경우 다른 사용자와 공유).

답변

관련 문제