{ "info": { "author": "Rafael Oliveira", "author_email": "rafaelbco@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Plone :: 4.3", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "collective.anotherdynamicgroupsplugin\n=====================================\n\nOverview\n--------\n\nProducts.PluggableAuthService provides a \"Dynamic Groups Plugin\". You can add \"virtual\" groups, and\nfor each of them Membership is established via a predicate, expressed as a TALES expression.\n\nThis package aims to provide a similar functionality, but in a different way. Once the\n\"Another Dynamic Groups Plugin\" is installed it will lookup registered group providers (technicaly\nthese are named multi-adapters for the user and the request). Each group provider will provide a\nset of groups which the user is a member of. It's similar to `borg.localrole`_ but for\ngroups.\n\n.. NOTE::\n A group provider can also provide membership for regular (non-virtual) groups.\n\nThe provided plugin is also a \"groups introspection plugin\". It means the \"virtual\" groups created\nare shown in the Plone management UI for groups. Actually, if we don't do that the\n``@@usergroup-userprefs`` view breaks.\n\nCompatibility\n-------------\n\nCurrent version was tested with Plone 4.3. Probably it will work for any version in the 4.x series.\n\nInstallation\n------------\n\nThe usual: make the package available in the buildout and have its ZCML loaded. Then you can install\nit as a Plone add-on into a Plone Site.\n\nUsage\n-----\n\nOnce the add-on is installed you can add \"virtual\" groups. These will be the groups dynamically\nassigned to the users by the plugin. This can also be done through the ZMI::\n\n >>> from collective.anotherdynamicgroupsplugin.util import add_virtual_group\n >>> add_virtual_group(group_id='group1', title='Group 1')\n >>> add_virtual_group(group_id='group2', title='Group 2')\n\nWe'll also add a regular group, since group providers can assign users to these too::\n\n >>> from plone import api\n >>> api.group.create(groupname='group3', title='Group 3')\n >> for u_id in ('user1', 'user2', 'user3'):\n ... api.user.create(username=u_id, email=u_id + '@test.org')\n >> from collective.anotherdynamicgroupsplugin.interfaces import IGroupProvider\n >>> from zope.component import provideAdapter\n >>> from zope.interface import implements\n >>> from zope.publisher.interfaces.http import IHTTPRequest\n >>> from Products.PluggableAuthService.interfaces.authservice import IBasicUser\n >>> class ProvideGroup1ToAll(object):\n ... implements(IGroupProvider)\n ... def __init__(self, user, request):\n ... self.user = user\n ... self.request = request\n ... def __call__(self):\n ... return ['group1']\n >>> provideAdapter(\n ... ProvideGroup1ToAll,\n ... adapts=(IBasicUser, IHTTPRequest),\n ... name=ProvideGroup1ToAll.__name__\n ... )\n\nThe second adapter makes the user member of the group with correspondent name::\n\n >>> class ProvideCorrespondentGroup(object):\n ... implements(IGroupProvider)\n ... def __init__(self, user, request):\n ... self.user = user\n ... self.request = request\n ... def __call__(self):\n ... if not self.user.getId().startswith('user'):\n ... return []\n ... number = self.user.getId()[-1]\n ... return ['group' + number]\n >>> provideAdapter(\n ... ProvideCorrespondentGroup,\n ... adapts=(IBasicUser, IHTTPRequest),\n ... name=ProvideCorrespondentGroup.__name__\n ... )\n\nNow let's check if the groups are correctly assigned to each user::\n\n >>> sorted(g.getId() for g in api.group.get_groups(username='user1'))\n ['AuthenticatedUsers', 'group1']\n\n >>> sorted(g.getId() for g in api.group.get_groups(username='user2'))\n ['AuthenticatedUsers', 'group1', 'group2']\n\n >>> sorted(g.getId() for g in api.group.get_groups(username='user3'))\n ['AuthenticatedUsers', 'group1', 'group3']\n\nTest clean-up::\n\n >>> from zope.component import getGlobalSiteManager\n >>> sm = getGlobalSiteManager()\n >>> for a in (ProvideGroup1ToAll, ProvideCorrespondentGroup):\n ... removed = sm.unregisterAdapter(\n ... provided=IGroupProvider,\n ... required=(IBasicUser, IHTTPRequest),\n ... name=a.__name__\n ... )\n >>> list(sm.registeredAdapters())\n []\n\n\n.. References\n.. _`borg.localrole`: http://pypi.python.org/pypi/borg.localrole\n\n\n\n\n\n\nChangelog\n---------\n\n1.0.0 (2015-03-20)\n~~~~~~~~~~~~~~~~~~\n\n- Plone 4.3 compatibility.\n- Added documentation stating that membership to regular (non-virtual) groups can also be provided by group providers.\n\n\n0.3 (2012-01-11)\n~~~~~~~~~~~~~~~~\n\n- Fixed MANIFEST.in.\n\n0.2 (2012-01-11)\n~~~~~~~~~~~~~~~~\n\n- Added MANIFEST.in so the sdist is not broken.\n\n\n0.1 (2012-01-11)\n~~~~~~~~~~~~~~~~\n\n- First release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/collective/collective.anotherdynamicgroupsplugin", "keywords": "plone pas groups", "license": "GPL version 2", "maintainer": null, "maintainer_email": null, "name": "collective.anotherdynamicgroupsplugin", "package_url": "https://pypi.org/project/collective.anotherdynamicgroupsplugin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.anotherdynamicgroupsplugin/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/collective/collective.anotherdynamicgroupsplugin" }, "release_url": "https://pypi.org/project/collective.anotherdynamicgroupsplugin/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Another way to define dynamic user groups in Plone.", "version": "1.0.0" }, "last_serial": 1469707, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "23518c593b4caf33312925a7d793dec4", "sha256": "dcb821c211b1e502d883dd8b656c20b082f1922008997cc0a61f30c3b563a83f" }, "downloads": -1, "filename": "collective.anotherdynamicgroupsplugin-0.1.tar.gz", "has_sig": false, "md5_digest": "23518c593b4caf33312925a7d793dec4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5767, "upload_time": "2012-01-11T18:19:31", "url": "https://files.pythonhosted.org/packages/58/ce/0cd3ee945bdec89271498d3dfedfbfc7247c05ed4805d36e3a9d705112a3/collective.anotherdynamicgroupsplugin-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "16543d382d0a20a1b884c23d703bec57", "sha256": "d8f4cfed955314273342ede005ed7019ba17ab377a69691677496548d70b7f98" }, "downloads": -1, "filename": "collective.anotherdynamicgroupsplugin-0.2.tar.gz", "has_sig": false, "md5_digest": "16543d382d0a20a1b884c23d703bec57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6271, "upload_time": "2012-01-11T18:57:09", "url": "https://files.pythonhosted.org/packages/6a/21/8e49f5013df81bec09cc67df0eafc28201df31da152dede956c511ffe63e/collective.anotherdynamicgroupsplugin-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "78bc7c82cba5d8039aa45e31b8a6320b", "sha256": "8676b75a2bb32545ae6eb330f84557717853d2d424716c5067d79a0f2f9b5d23" }, "downloads": -1, "filename": "collective.anotherdynamicgroupsplugin-0.3.tar.gz", "has_sig": false, "md5_digest": "78bc7c82cba5d8039aa45e31b8a6320b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6747, "upload_time": "2012-01-11T19:15:31", "url": "https://files.pythonhosted.org/packages/a2/dd/a4ca5385148be7548710489db049126536249fc4aebff7a9639d87c11af5/collective.anotherdynamicgroupsplugin-0.3.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "cbb6628c476c9095d8968e948614476b", "sha256": "c76ad10322ff3be099df0f052b4cbb453920b637990ae37d10b18990aaba49f7" }, "downloads": -1, "filename": "collective.anotherdynamicgroupsplugin-1.0.0.tar.gz", "has_sig": false, "md5_digest": "cbb6628c476c9095d8968e948614476b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9250, "upload_time": "2015-03-20T12:03:17", "url": "https://files.pythonhosted.org/packages/58/92/bc8ca14c282b98292fdcaa5374dd9be560099003ea4ed6d099699027c3a9/collective.anotherdynamicgroupsplugin-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cbb6628c476c9095d8968e948614476b", "sha256": "c76ad10322ff3be099df0f052b4cbb453920b637990ae37d10b18990aaba49f7" }, "downloads": -1, "filename": "collective.anotherdynamicgroupsplugin-1.0.0.tar.gz", "has_sig": false, "md5_digest": "cbb6628c476c9095d8968e948614476b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9250, "upload_time": "2015-03-20T12:03:17", "url": "https://files.pythonhosted.org/packages/58/92/bc8ca14c282b98292fdcaa5374dd9be560099003ea4ed6d099699027c3a9/collective.anotherdynamicgroupsplugin-1.0.0.tar.gz" } ] }