Users provides information useful for forcing a user to log in or out, and retrieving information about the user who is currently logged-in.
- CLASS AppEngine::Users::User
| Service | = | UserServiceFactory.getUserService |
Returns true if the user making this request is an admin for this application, false otherwise.
This is a separate function, and not a member function of the User class, because admin status is not persisted in the datastore. It only exists for the user making this request right now.
Source: show
# File lib/appengine-apis/users.rb, line 68 def admin? Service.is_user_admin? end
Computes the login URL for this request and specified destination URL.
Args:
- dest_url: The desired final destination URL for the user
once login is complete. If +dest_url+ does not have a host specified, we will use the host from the current request.
Source: show
# File lib/appengine-apis/users.rb, line 43 def create_login_url(url) Service.create_login_url(url) end
Computes the logout URL for this request and specified destination URL.
Args:
- dest_url: String that is the desired final destination URL for the
user once logout is complete. If +dest_url+ does not have a host specified, uses the host from the current request.
Source: show
# File lib/appengine-apis/users.rb, line 53 def create_logout_url(url) Service.create_logout_url(url) end
If the user is logged in, this method will return a User that contains information about them. Note that repeated calls may not necessarily return the same User object.
Source: show
# File lib/appengine-apis/users.rb, line 33 def current_user Service.current_user end
Returns true if there is a user logged in, false otherwise.
Source: show
# File lib/appengine-apis/users.rb, line 58 def logged_in? Service.is_user_logged_in? end