Neil
Neil

Reputation: 6039

Checking User's role in Google appengine

Need to check if the logged in user is a Developer, Owner or Viewer in google appengine in java.

This page explains about putting constraint such that the user have to be Administrator but I did not find any Java API whcih can give me the role .

Upvotes: 0

Views: 216

Answers (2)

Isaac
Isaac

Reputation: 788

Unfortunately this is not possible. The Users service does not distinguish between different roles.

Per the python docs (I can't find this in the java documentaion):

An administrator is a user who can access the Administration Console for the application.

The api call checks for the presence of 'X-AppEngine-Inbound-User-Is-Admin' in the headers.

Upvotes: 1

Daniel Roseman
Daniel Roseman

Reputation: 599778

The UserService has an isUserAdmin() method which gives this information.

Upvotes: 1

Related Questions