http://code.google.com/appengine/docs/users/functions.html
With this ?
is_current_user_admin()
Returns True if the current user is signed in and is currently
registered as an administrator of this application.
On 5 sep, 13:20, amshuhu <[EMAIL PROTECTED]> wrote:
> here is my sample coding ,i simply create a page in that i get the
> details like name and email id of the users and when i click sumit it
> will redirect to next page ,in that page we can view the users detail
> which given in the first page thus i create code, here is the code
>
> from google.appengine.ext import db
> from google.appengine.ext import webapp
> from google.appengine.ext.webapp.util import run_wsgi_app
> from google.appengine.ext.webapp import template
>
> class Shout(db.Model):
> name = db.StringProperty(required=True)
> when = db.DateTimeProperty(auto_now_add=True)
> email = db.StringProperty()
>
> class Sample(webapp.RequestHandler):
> def get(self):
> self.response.out.write(template.render('help.html', {}))
>
> def post(self):
> shout =
> Shout(name=self.request.get('name'),email=self.request.get('email'))
> shout.put()
> self.redirect('/help1.html')
>
> class Data(webapp.RequestHandler):
> def get(self):
> shouts = db.GqlQuery('SELECT * FROM Shout')
> values = {'shouts':shouts}
> self.response.out.write(template.render('help1.html', values))
>
> application = webapp.WSGIApplication(
> [('/', Sample),('/
> help1.html',Data)],
> debug=True)
>
> def main():
> run_wsgi_app(application)
>
> if __name__ == "__main__":
> main()
>
> now i need to add a admin control ,when users sumit the data the admin
> only can view the data ,other users should not view the page and
> please inform me wat are the handlers need to add in app.yaml ,please
> help me any one i am in confuse
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---