5
我有一個使用formalchemy管理界面的金字塔項目。我添加了基本的ACL身份驗證,並且即使通過身份驗證,pyramid_formalchemy插件也始終拒絕。金字塔和FormAlchemy管理界面
有關如何只允許經過身份驗證的用戶使用pyramid_formalchemy管理界面的想法?
授權策略是添加這樣的:
authn_policy = AuthTktAuthenticationPolicy('MYhiddenSECRET', callback=groupfinder) authz_policy = ACLAuthorizationPolicy() config = Configurator( settings=settings, root_factory='package.auth.RootFactory', authentication_policy=authn_policy, authorization_policy=authz_policy ) # pyramid_formalchemy's configuration config.include('pyramid_formalchemy') config.include('fa.jquery') config.formalchemy_admin('admin', package='package', view='fa.jquery.pyramid.ModelView')
偉大的答案,很好的解釋。謝謝! – 2011-04-16 03:42:01