On Tue, Mar 9, 2010 at 4:07 AM, Massimiliano
<[email protected]> wrote:
> Dear All,
> using the Users Google library, I can have my own users or it refer only to
> the Google Users. (I trying to understand if there is an easy way to manage
> the users, I don't want wave too many code lines and I need to have specif
> field in the registration form).

Here's how I address these problems in my app.

I use the users email address as their ID

First I require all my users to have a google account for their email address.
If they don't already have an account I send them to:

    https://www.google.com/accounts/NewAccount

First thing the MainPage I have the following code.

        user = users.get_current_user()
        if user == None:
            self.redirect(users.create_login_url(self.request.uri))
        else :
            email = user.email().lower()

At this point I know google has authenticated the user.
But it could be anyone of Google gazillion users,
not necessarily one of my users.

I need to check if it's one of my users,  so I create

        class MyUsers(db.Model):
            uemail = db.StringProperty()
            .
            .
            .

I know there is a db.EmailProperty(), but it is too hypersensitive and
does not allow Null values,  sometimes I want to set up an entry before
I have gathered all the necessary info, db.StringProperty() is less of a
hassle.

I import the list of valid users from an external application using the
bulkloader.

Actually I have some more tables (I'm stuck on sql nomemclature)
that list admin users, and other kinds of users with different privileges.

So before I let a user do anything I check to appropriate table,
admin, regular users, etc.  to see if the email that google validated
for has the appropriate privileges.

-- 
Drew Einhorn

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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-appengine?hl=en.

Reply via email to