{ "info": { "author": "Riccardo Lemmi", "author_email": "riccardo@reflab.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\n The plugin creates a virtual group and helps to assign this group to\n users by evaluation of a TALES expression.\n\nInstallation\n============\n\n Buildout\n\n See docs/INSTALL.txt\n\n Plone Site\n\n - Go in the site acl_users then add \"Group Assigner\"\n - Set the properties: group id, group title and the condition\n (see below for the meaning of 'debug')\n - Activate all the functionalities provided by the plugin\n\nNotes\n=====\n\n The expression is based only on principal methods and attributes.\n It is not possible to assign the group on context base.\n\n Variable available are:\n\n principal\n portal\n nothing\n modules\n\n From 'principal' you can use the 'getProperty' method to use in your\n expression. For example:\n\n python: principal.getProperty('email').split('@')[-1] in ['reflab.com',]\n\n To assign more than one group you have to add one plugin for each group.\n\n To cache the plugin add a RAMCache manager and assign the plugin to him.\n If the plugin is cached remember to invalidate the cache when changing\n properties.\n\n You can activate the 'debug' properties to log the evaluation of the\n expression (in this case don't use cache).\n\nOther infos\n===========\n\n Questions and comments to riccardo@reflab.com\n\n Report bugs at riccardo@reflab.com\n\n Code repository: http://svn.plone.org/svn/collective/PASPlugins/pas.plugins.groupassigner\n\nChange history\n**************\n\n1.0 (2010-07-02)\n----------------\n\n- Released plugin\n\nDetailed Documentation\n**********************\n\nTests for pas.plugins.groupassigner\n\nTest setup\n----------\n\n >>> from Testing.ZopeTestCase import user_password\n >>> from Products.Five.testbrowser import Browser\n >>> browser = Browser()\n\nPlugin setup\n------------\n\n >>> acl_users_url = \"%s/acl_users\" % self.portal.absolute_url()\n >>> browser.addHeader('Authorization', 'Basic %s:%s' % ('portal_owner', user_password))\n\n >>> self.portal.acl_users.userFolderAddUser('test_user_2_', 'secret', ['Member'], [])\n >>> u1 = self.portal.acl_users.getUserById('test_user_1_')\n >>> gtool = self.portal.portal_groups\n >>> gtool.addGroup('group1', ())\n True\n\npas.plugins.groupassigner should be in the list of installable plugins:\n\n >>> browser.open(\"%s/manage_main\" % acl_users_url)\n >>> browser.url\n 'http://nohost/plone/acl_users/manage_main'\n >>> form = browser.getForm(index=0)\n >>> select = form.getControl(name=':action')\n\n >>> 'Group Assigner' in select.displayOptions\n True\n\nand we can select it:\n\n >>> select.getControl('Group Assigner').click()\n >>> select.displayValue\n ['Group Assigner']\n >>> select.value\n ['manage_addProduct/pas.plugins.groupassigner/manage_add_groupassigner_form']\n\nwe add 'Group Assigner' to acl_users:\n\n >>> from pas.plugins.groupassigner.plugin import GroupAssigner\n >>> assigner = GroupAssigner('group_assigner_test', 'Group Assigner')\n >>> assigner.group = 'group1'\n >>> assigner.condition = \"python: 'reflab.com' in principal.getProperty('email')\"\n >>> self.portal.acl_users['group_assigner_test'] = assigner\n >>> assigner = self.portal.acl_users['group_assigner_test']\n\nNow the tests:\n\n >>> assigner.getGroupsForPrincipal(u1)\n ()\n >>> assigner.getGroupMembers('group1')\n ()\n >>> u1.setProperties(email='u1@reflab.com')\n >>> assigner.getGroupsForPrincipal(u1)\n ('group1',)\n >>> assigner.getGroupMembers('group1')\n ()\n\n >>> assigner.enumerateGroups()\n [{'pluginid': 'group_assigner_test', 'title': 'Group Assigner', 'id': 'group1', 'groupid': 'group1'}]\n >>> assigner.enumerateGroups(id='group1')\n [{'pluginid': 'group_assigner_test', 'title': 'Group Assigner', 'id': 'group1', 'groupid': 'group1'}]\n >>> assigner.enumerateGroups(id='groupX')\n []\n\nContributors\n************\n\nRiccardo Lemmi, Reflab Srl", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.reflab.com", "keywords": "", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "pas.plugins.groupassigner", "package_url": "https://pypi.org/project/pas.plugins.groupassigner/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pas.plugins.groupassigner/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.reflab.com" }, "release_url": "https://pypi.org/project/pas.plugins.groupassigner/1.0/", "requires_dist": null, "requires_python": null, "summary": "Assign a group to user based on an expression.", "version": "1.0" }, "last_serial": 796034, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "9c44a719c6eb8a265645424047d15aad", "sha256": "5761644fefead87555d51e1de84ccd6bddd3d3c890a947cd2e5fe14371e3ed75" }, "downloads": -1, "filename": "pas.plugins.groupassigner-1.0.tar.gz", "has_sig": false, "md5_digest": "9c44a719c6eb8a265645424047d15aad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14277, "upload_time": "2010-07-02T18:15:32", "url": "https://files.pythonhosted.org/packages/86/26/5d41ec5188a8a4d4cde83d209fc17c477cdd06ade8df1fe348e1db7f96e8/pas.plugins.groupassigner-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c44a719c6eb8a265645424047d15aad", "sha256": "5761644fefead87555d51e1de84ccd6bddd3d3c890a947cd2e5fe14371e3ed75" }, "downloads": -1, "filename": "pas.plugins.groupassigner-1.0.tar.gz", "has_sig": false, "md5_digest": "9c44a719c6eb8a265645424047d15aad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14277, "upload_time": "2010-07-02T18:15:32", "url": "https://files.pythonhosted.org/packages/86/26/5d41ec5188a8a4d4cde83d209fc17c477cdd06ade8df1fe348e1db7f96e8/pas.plugins.groupassigner-1.0.tar.gz" } ] }