def has_site_permission(user):
 mw = u'mezzanine.core.middleware.SitePermissionMiddleware'
 if (mw not in get_middleware_setting()):
  from warnings import warn
  warn((mw + u' missing from settings.MIDDLEWARE - per sitepermissions not applied'))
  return (user.is_staff and user.is_active)
 return getattr(user, u'has_site_permission', False)

def has_site_permission ( user ) : mw = u'mezzanine.core.middleware.SitePermissionMiddleware' if ( mw not in get_middleware_setting ( ) ) : from warnings import warn warn ( ( mw + u' missing from settings.MIDDLEWARE - per sitepermissions not applied' ) ) return ( user . is_staff and user . is_active ) return getattr ( user , u'has_site_permission' , False )
checks if a staff user has staff-level access for the current site .