Skip to content

Instantly share code, notes, and snippets.

@kindly
Created May 25, 2012 11:32
Show Gist options
  • Select an option

  • Save kindly/2787470 to your computer and use it in GitHub Desktop.

Select an option

Save kindly/2787470 to your computer and use it in GitHub Desktop.
site lockdown extension
def site_read(context, data_dict=None):
model = context['model']
user = context['user']
userobj = model.User.get( user )
if userobj:
return {'success': True}
return {'success': False, 'msg': 'You must be logged in see the site'}
class YourExtension(SigletonPlugin):
implements(IAuthPlugin, inherit=True)
def get_auth_functions():
return {'site_read': site_read}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment