Esempio n. 1
0
 def test_relativePath(self):
     profile_id = 'dummy_profile2'
     product_name = 'GenericSetup'
     profile_registry.registerProfile(
         profile_id, 'Dummy Profile', 'This is a dummy profile',
         'tests/metadata_profile', product=product_name)
     profile_info = profile_registry.getProfileInfo(
         '%s:%s' % (product_name, profile_id))
     self.assertEqual(profile_info['description'],
                      'Description from metadata')
Esempio n. 2
0
 def test_relativePath(self):
     profile_id = 'dummy_profile2'
     product_name = 'GenericSetup'
     profile_registry.registerProfile(
         profile_id, 'Dummy Profile', 'This is a dummy profile',
         'tests/metadata_profile', product=product_name)
     profile_info = profile_registry.getProfileInfo(
         '%s:%s' % (product_name, profile_id))
     self.assertEqual(profile_info['description'],
                      'Description from metadata')
Esempio n. 3
0
 def test_versionFromProduct(self):
     profile_id = "dummy_profile"
     product_name = "GenericSetup"
     directory = os.path.split(__file__)[0]
     path = os.path.join(directory, "default_profile")
     profile_registry.registerProfile(
         profile_id, "Dummy Profile", "This is a dummy profile", path, product=product_name
     )
     profile_info = profile_registry.getProfileInfo("%s:%s" % (product_name, profile_id))
     product = getattr(self.app.Control_Panel.Products, product_name)
     self.assertEqual(profile_info["version"], product.version)
Esempio n. 4
0
 def test_versionFromProduct(self):
     profile_id = 'dummy_profile'
     product_name = 'GenericSetup'
     directory = os.path.split(__file__)[0]
     path = os.path.join(directory, 'default_profile')
     profile_registry.registerProfile( profile_id,
                                       'Dummy Profile',
                                       'This is a dummy profile',
                                       path,
                                       product=product_name)
     profile_info = profile_registry.getProfileInfo('%s:%s' % (product_name,
                                                               profile_id))
     product = getattr(self.app.Control_Panel.Products, product_name)
     self.assertEqual(profile_info['version'], product.version)
Esempio n. 5
0
 def test_versionFromProduct(self):
     profile_id = 'dummy_profile'
     product_name = 'GenericSetup'
     directory = os.path.split(__file__)[0]
     path = os.path.join(directory, 'default_profile')
     profile_registry.registerProfile( profile_id,
                                       'Dummy Profile',
                                       'This is a dummy profile',
                                       path,
                                       product=product_name)
     profile_info = profile_registry.getProfileInfo('%s:%s' % (product_name,
                                                               profile_id))
     product = getattr(self.app.Control_Panel.Products, product_name)
     self.assertEqual(profile_info['version'], product.version)
Esempio n. 6
0
def initialize(context):

    context.registerClass(
        PluggableAuthService.PluggableAuthService,
        permission=ManageUsers,
        constructors=(PluggableAuthService.addPluggableAuthService, ),
        icon='www/PluggableAuthService.png')

    context.registerClass(HBAH.HTTPBasicAuthHelper,
                          permission=ManageUsers,
                          constructors=(
                              HBAH.manage_addHTTPBasicAuthHelperForm,
                              HBAH.addHTTPBasicAuthHelper,
                          ),
                          visibility=None,
                          icon='plugins/www/HTTPBasicAuthHelper.png')

    context.registerClass(IAH.InlineAuthHelper,
                          permission=ManageUsers,
                          constructors=(
                              IAH.manage_addInlineAuthHelperForm,
                              IAH.addInlineAuthHelper,
                          ),
                          visibility=None,
                          icon='plugins/www/InlineAuthHelper.png')

    context.registerClass(CAH.CookieAuthHelper,
                          permission=ManageUsers,
                          constructors=(
                              CAH.manage_addCookieAuthHelperForm,
                              CAH.addCookieAuthHelper,
                          ),
                          visibility=None,
                          icon='plugins/www/CookieAuthHelper.gif')

    context.registerClass(DAH.DomainAuthHelper,
                          permission=ManageUsers,
                          constructors=(
                              DAH.manage_addDomainAuthHelperForm,
                              DAH.manage_addDomainAuthHelper,
                          ),
                          visibility=None,
                          icon='plugins/www/DomainAuthHelper.png')

    context.registerClass(SAH.SessionAuthHelper,
                          permission=ManageUsers,
                          constructors=(
                              SAH.manage_addSessionAuthHelperForm,
                              SAH.manage_addSessionAuthHelper,
                          ),
                          visibility=None,
                          icon='plugins/www/SessionAuthHelper.gif')

    context.registerClass(ScriptablePlugin.ScriptablePlugin,
                          permission=ManageUsers,
                          constructors=(
                              ScriptablePlugin.manage_addScriptablePluginForm,
                              ScriptablePlugin.addScriptablePlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/ScriptablePlugin.png')

    context.registerClass(ZODBGroupManager.ZODBGroupManager,
                          permission=ManageGroups,
                          constructors=(
                              ZODBGroupManager.manage_addZODBGroupManagerForm,
                              ZODBGroupManager.addZODBGroupManager,
                          ),
                          visibility=None,
                          icon='plugins/www/ZODBGroupManager.gif')

    context.registerClass(ZODBUserManager.ZODBUserManager,
                          permission=ManageUsers,
                          constructors=(
                              ZODBUserManager.manage_addZODBUserManagerForm,
                              ZODBUserManager.addZODBUserManager,
                          ),
                          visibility=None,
                          icon='plugins/www/ZODBUserManager.gif')

    context.registerClass(ZODBRoleManager.ZODBRoleManager,
                          permission=ManageUsers,
                          constructors=(
                              ZODBRoleManager.manage_addZODBRoleManagerForm,
                              ZODBRoleManager.addZODBRoleManager,
                          ),
                          visibility=None,
                          icon='plugins/www/ZODBRoleManager.gif')

    context.registerClass(LocalRolePlugin.LocalRolePlugin,
                          permission=ManageUsers,
                          constructors=(
                              LocalRolePlugin.manage_addLocalRolePluginForm,
                              LocalRolePlugin.addLocalRolePlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/ZODBRoleManager.gif')

    context.registerClass(DMP.DelegatingMultiPlugin,
                          permission=ManageUsers,
                          constructors=(
                              DMP.manage_addDelegatingMultiPluginForm,
                              DMP.manage_addDelegatingMultiPlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/DelegatingMultiPlugin.png')

    context.registerClass(SPP.SearchPrincipalsPlugin,
                          permission=ManageUsers,
                          constructors=(
                              SPP.addSearchPrincipalsPluginForm,
                              SPP.addSearchPrincipalsPlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/DelegatingMultiPlugin.png')

    context.registerClass(RGP.RecursiveGroupsPlugin,
                          permission=ManageUsers,
                          constructors=(
                              RGP.manage_addRecursiveGroupsPluginForm,
                              RGP.addRecursiveGroupsPlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/RecursiveGroupsPlugin.png')

    context.registerClass(DGP.DynamicGroupsPlugin,
                          permission=ManageUsers,
                          constructors=(
                              DGP.manage_addDynamicGroupsPluginForm,
                              DGP.addDynamicGroupsPlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/DynamicGroupsPlugin.png')

    context.registerClass(CPC.ChallengeProtocolChooser,
                          permission=ManageUsers,
                          constructors=(
                              CPC.manage_addChallengeProtocolChooserForm,
                              CPC.addChallengeProtocolChooserPlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/DelegatingMultiPlugin.png')

    context.registerClass(RTS.RequestTypeSniffer,
                          permission=ManageUsers,
                          constructors=(
                              RTS.manage_addRequestTypeSnifferForm,
                              RTS.addRequestTypeSnifferPlugin,
                          ),
                          visibility=None,
                          icon='plugins/www/DelegatingMultiPlugin.png')

    context.registerClass(NCH.NotCompetent_byRoles,
                          permission=ManageUsers,
                          constructors=(
                              NCH.manage_addNotCompetent_byRolesForm,
                              NCH.manage_addNotCompetent_byRoles,
                          ),
                          visibility=None)

    if profile_registry is not None:

        context.registerClass(PluggableAuthService.PluggableAuthService,
                              meta_type='Configured PAS',
                              permission=ManageUsers,
                              constructors=(
                                  PluggableAuthService.addConfiguredPASForm,
                                  PluggableAuthService.addConfiguredPAS,
                              ),
                              icon='www/PluggableAuthService.png')
        try:
            profile_registry.getProfileInfo('PluggableAuthService:simple')
        except KeyError:
            # not yet registered
            profile_registry.registerProfile(
                'simple',
                'Simple PAS Content Profile',
                'Content for a simple PAS.',
                'profiles/simple',
                'PluggableAuthService',
                BASE,
                IPluggableAuthService,
            )
        try:
            profile_registry.getProfileInfo('PluggableAuthService:empty')
        except KeyError:
            # not yet registered
            profile_registry.registerProfile(
                'empty',
                'Empty PAS Content Profile',
                'Content for an empty PAS '
                '(plugins registry only).',
                'profiles/empty',
                'PluggableAuthService',
                BASE,
                IPluggableAuthService,
            )