Sunday 15 August 2010

How do you know if the current user is an admin with app engine cloud endpoints? -


I know that there is a get_current_user function in the endpoint module, but as far as I know , The user object does not have any property or address that the user is an admin or not.

The first answer was very helpful for me. It requires that you use the Google + sign in button, But this is a good temporary sollution. The reason for this is that I want to do some more work, because I want to use it for admin console pages, in this situation, the administrator has already entered Google, so it looks strange when there is a Google+ login button .

Another way to implement it will be to create my own Ohoth system, where a script in the admin page requests a general request, which requests that the user is the administrator, and if This is so, in a way, the administrator token, which gives the user access to my endpoint methods. With each endpoint request, I'm already using a similar token system, which is part of the application, because I can not use Google Accounts for the app. The token is valid only for a limited time, and for limited requests.

No comments:

Post a Comment