Dmitriy, Only domain admins have API access, either through ClientLogin or through OAuth, so your logged in-user won't be able to get the list of his groups by himself.
I'm not sure if I fully understand your use case so there's probably not a ready workaround, but you may be able to create an App Engine app to have the admin fetch the user's groups and store it somewhere, which the user can then retrieve and have the list of books accordingly filtered out. Prashant Tiwari | Google Developer Relations <http://code.google.com> On Fri, Mar 11, 2011 at 6:16 PM, Dmitriy <[email protected]>wrote: > Hi, > > I'm trying to create Apps-based application and want to use existing Apps > Domain Groups to understand what should user authenticated with 3-Legged > OAuth see in my application. > > For example, in case user is in group [email protected], he should > not see C# books in the list, but should see Java books. This way when user > f.e. [email protected] logs in to my application using 3-legged OAuth, > I'd like to get list of groups he belongs to. > > I used the com.google.gdata.client.appsforyourdomain.AppsGroupsService# > retrieveGroups(memberName, directOnly) and it works perfectly until user > is Domain Admin. Otherwise I get the "You are not authorized to access this > API" exception. > > In addition to 3-Legged OAuth I tried simple username-password > authentication. Result is actually the same. > > > So my questions are: > > > 1. Is mentioned scenario some known limitation or I work with API > incorrectly? > 2. Can non-admin user get list of groups he belongs to in any other > way? > > > PS: Could not find appropriate issue in tracker. > > Thanks, > Dmitiry > > -- > You received this message because you are subscribed to the Google Groups > "Google Apps Domain Information and Management APIs" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-apps-mgmt-apis?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.
