{ "info": { "author": "Mike Heald", "author_email": "mike.heald@canonical.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "What it does\r\n------------\r\n\r\ndjango-group-access restricts access to records based on group membership.\r\nIt does not manage finer grained permissions such as editing or deleting.\r\nIf a user has access to a record, they have all permissions as defined\r\nby the django auth permissions.\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nAdd 'django_group_access' to your INSTALLED_APPS in settings.py\r\n\r\n\r\nIntegration and use\r\n-------------------\r\n\r\nExample: Installing to a single model and restricting access in a view\r\n\r\nmodels.py\r\n\r\n from django.db import models\r\n from django_group_access import registration\r\n\r\n\r\n class MyModel(models.Model):\r\n name = models.CharField(max_length=24)\r\n\r\n registration.register(MyModel)\r\n\r\nMyModel will gain access_groups which is a ManyToManyField containing\r\nthe groups that have access to each record.\r\n\r\nMyModel will also gain 'owner' which is a ForeignKey to\r\ndjango.contrib.auth.models.User and is used to determine ownership\r\nof the record. To not use and 'owner' field, pass:\r\n\r\n owner=False\r\n\r\nto the call to register().\r\n\r\n\r\nviews.py\r\n\r\n def my_view(request):\r\n records = MyModel.objects.accessible_by_user(request.user)\r\n\r\nAll related fields and reverse relationships for model instances in\r\n`records` will be filtered for the same user automatically.\r\n\r\n\r\nAccess to \"parent\" records can be determined by access the user has\r\nto \"child\" records. In the following example, if you have access to a Room\r\nyou have access to the House it appears in.\r\n\r\n\r\n from django.db import models\r\n from django_group_access import registration\r\n\r\n\r\n class House(models.Model):\r\n address = models.CharField(max_length=128)\r\n\r\n\r\n class Room(models.Model):\r\n house = models.ForeignKey(House)\r\n name = models.CharField(max_length=32)\r\n\r\n\r\n registration.register(Room)\r\n registration.register(House, control_relation='room')\r\n\r\n houses = House.objects.accessible_by_user(user_object)\r\n\r\n\r\nThe group model used for access control is AccessGroup. This is\r\nseparate from the django auth Group for flexbility.\r\n\r\n\r\nSharing records\r\n---------------\r\n\r\n obj = MyModel.objects.accessible_by_user(user_object)[0]\r\n \r\n group_i_want_to_share_with = AccessGroup.objects.get(name='Friends')\r\n \r\n obj.access_groups.add(group_i_want_to_share_with)\r\n\r\n`obj` would then become visible to members of the 'Friends' AccessGroup.\r\n\r\nFor ease of sharing data between groups, AccessGroup has a property called\r\n`auto_share_groups`. This is a list of AccessGroups that records owned\r\nby the group will automatically be shared with.\r\n\r\n\r\nPublic record mode\r\n------------------\r\n\r\nIf you want to have all data public by default, and use the access groups\r\nto restrict access to individual records add the following to settings.py\r\n\r\n DGA_UNSHARED_RECORDS_ARE_PUBLIC = True\r\n\r\n\r\nAutomatically restricting based on logged in user\r\n-------------------------------------------------\r\n\r\nAdd 'django_group_access.middleware.DjangoGroupAccessMiddleware' to the\r\nMIDDLEWARE_CLASSES in settings.py. All access controlled models will be filtered\r\nbased on the currently logged in user, meaning you do not have to call\r\n'accessible_by_user' in your code. Anonymous users will see no records.\r\n\r\nThe middleware must be come after the AuthenticationMiddleware in the list\r\nof MIDDLEWARE_CLASSES.\r\n\r\nRegistering a model with 'auto_filter=False' will stop the automatic\r\nfiltering for that model, meaning you will have to do it manually using\r\n'accessible_by_user' in your code.\r\n\r\n\r\nAccess to unrestricted records\r\n------------------------------\r\n\r\nRegistering a model with the option 'unrestricted_manager=\"manager_name\"' will\r\ncreate a manager on that model with unrestricted access to all records, even if\r\nyou are using the automatic restriction based on the logged in user.\r\n\r\nExample:\r\n\r\n registration.register(MyModel, unrestricted_manager='all_objects')\r\n \r\n all_records = MyModel.all_objects.all()", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://launchpad.net/django-group-access", "keywords": "django,ownership,models", "license": "LGPLv3", "maintainer": "", "maintainer_email": "", "name": "django-group-access", "package_url": "https://pypi.org/project/django-group-access/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-group-access/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://launchpad.net/django-group-access" }, "release_url": "https://pypi.org/project/django-group-access/1.1.17/", "requires_dist": null, "requires_python": null, "summary": "Base Django model to add access control, via groups, to objects.", "version": "1.1.17" }, "last_serial": 967673, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c07c03b560225004bd81945a2044371b", "sha256": "941e331f56cf62963e1ce3e7d005384b5b869935d94d1a926631819076f40b56" }, "downloads": -1, "filename": "django-group-access-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c07c03b560225004bd81945a2044371b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5777, "upload_time": "2011-09-28T16:09:30", "url": "https://files.pythonhosted.org/packages/3c/95/739a11019d77a3266b697043f1564542d58cb134ae15b4b6168510be1fd0/django-group-access-0.0.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "c3e2a7af0b5b7fff9efe8eb5af212dce", "sha256": "e0b407c98a23c7b4437c2d83f9f74e217a3aea84d7adaf983d29281509637f29" }, "downloads": -1, "filename": "django-group-access-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c3e2a7af0b5b7fff9efe8eb5af212dce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12864, "upload_time": "2012-03-19T14:07:52", "url": "https://files.pythonhosted.org/packages/49/0b/6337197a60921d08bece28362ae68cbc88e85adf3cb700b2d9c0f0fbdcd7/django-group-access-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5097a19b1a3005e5816bbcd0ffd001f1", "sha256": "21d1baee7fc439b9f7e3c20376d0daaa77d0fe7372aa17216c7187b4757a15a4" }, "downloads": -1, "filename": "django-group-access-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5097a19b1a3005e5816bbcd0ffd001f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12582, "upload_time": "2012-03-21T10:07:23", "url": "https://files.pythonhosted.org/packages/5f/03/1f223d3698b3496c4b3b5217bf41dc1584501aeadfd9f241a2bb7a446d3f/django-group-access-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "bdad6bafa12b42ac01cc6925194675a8", "sha256": "259dddc7ac43fe9500a16d83de2dbe7f7a6d3ff5d447233c8760a9fd81aba633" }, "downloads": -1, "filename": "django-group-access-1.0.2.tar.gz", "has_sig": false, "md5_digest": "bdad6bafa12b42ac01cc6925194675a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13764, "upload_time": "2012-03-22T10:37:28", "url": "https://files.pythonhosted.org/packages/32/90/ab0ba9282c7e197516d7735a808aa999aa24efced992301cc659f9e97448/django-group-access-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "6159ecd429878a9e9a9840d7374487bc", "sha256": "63e2f557bdcc8495ddf3c2db24c14169f72d5757955e911d70bfc44b5f3ffbfa" }, "downloads": -1, "filename": "django-group-access-1.1.0.tar.gz", "has_sig": false, "md5_digest": "6159ecd429878a9e9a9840d7374487bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14357, "upload_time": "2012-03-29T14:51:44", "url": "https://files.pythonhosted.org/packages/c0/24/811fb79d172256a75ab2243224b25db1c65b79d2dd077449017f8ec3c1b5/django-group-access-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "14323eb3bb4d6db437de68a5ba1ae346", "sha256": "4de669cd205ce4ba072094586c583a80d973a7a102cde7778c95f70687ceccbc" }, "downloads": -1, "filename": "django-group-access-1.1.1.tar.gz", "has_sig": false, "md5_digest": "14323eb3bb4d6db437de68a5ba1ae346", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14335, "upload_time": "2012-03-30T11:44:06", "url": "https://files.pythonhosted.org/packages/9f/82/a237a2985333e5582d1046d4db01a18376249698fef1195f76d4282f7ecb/django-group-access-1.1.1.tar.gz" } ], "1.1.10": [ { "comment_text": "", "digests": { "md5": "d980e2ebd18619bb118530ed984d2be2", "sha256": "ab53288555ed3a62ab2d8a1e6d9ab5b15c7493ead46df68cb36f7542e591d054" }, "downloads": -1, "filename": "django-group-access-1.1.10.tar.gz", "has_sig": false, "md5_digest": "d980e2ebd18619bb118530ed984d2be2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16558, "upload_time": "2012-08-24T11:06:15", "url": "https://files.pythonhosted.org/packages/29/1b/e68cc60c4baa4fd71b0ee7ecafde2cdbaec5a52da51c329abc20ec1ca01e/django-group-access-1.1.10.tar.gz" } ], "1.1.11": [ { "comment_text": "", "digests": { "md5": "900969fe92fb10f0c35e7d0c702928e5", "sha256": "4539b6dbfbe54ed36c4143b3ed986976177b928e3bbec57e0a42dc7b450d63a3" }, "downloads": -1, "filename": "django-group-access-1.1.11.tar.gz", "has_sig": false, "md5_digest": "900969fe92fb10f0c35e7d0c702928e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16681, "upload_time": "2012-09-26T12:48:39", "url": "https://files.pythonhosted.org/packages/9a/91/17bf2bac2d7ffa1aaff4be11c96782f5af314d27d2d4f8822cdf8658039a/django-group-access-1.1.11.tar.gz" } ], "1.1.12": [ { "comment_text": "", "digests": { "md5": "efdfc2cb04a347f633f8a139f100b931", "sha256": "4d0ae9fb712f9c0b810307a10eb2b21396d4a27ca887aec31c42039a0a713462" }, "downloads": -1, "filename": "django-group-access-1.1.12.tar.gz", "has_sig": false, "md5_digest": "efdfc2cb04a347f633f8a139f100b931", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16784, "upload_time": "2012-10-10T14:27:35", "url": "https://files.pythonhosted.org/packages/6d/00/0d8279e0a75ae6f343bd09f191280efef050dbf747d1dc436b4868379ad4/django-group-access-1.1.12.tar.gz" } ], "1.1.13": [ { "comment_text": "", "digests": { "md5": "1bb997f6b19d65b7843c330a69b1ffa6", "sha256": "ebf2794ccb7d17df481f7db883f04ad1875293a955c4b129ead2c64f057062ad" }, "downloads": -1, "filename": "django-group-access-1.1.13.tar.gz", "has_sig": false, "md5_digest": "1bb997f6b19d65b7843c330a69b1ffa6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17210, "upload_time": "2013-06-17T15:32:59", "url": "https://files.pythonhosted.org/packages/33/a8/841732df79337b3ce6df00f1d472a95c174528d152338a213d1847c05895/django-group-access-1.1.13.tar.gz" } ], "1.1.14": [ { "comment_text": "", "digests": { "md5": "d1392b342a5b0878720ca120ccf06d5c", "sha256": "fdd232e4e96719ddec5cc6b1fb96c2cb9289beea6c28f8edf1c675ce44c21272" }, "downloads": -1, "filename": "django-group-access-1.1.14.tar.gz", "has_sig": false, "md5_digest": "d1392b342a5b0878720ca120ccf06d5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17659, "upload_time": "2013-06-24T11:33:39", "url": "https://files.pythonhosted.org/packages/cb/d9/522ac88a1a88413609f03eb0d386a039572b1edebc1626be5814d473bc44/django-group-access-1.1.14.tar.gz" } ], "1.1.15": [ { "comment_text": "", "digests": { "md5": "dccf121a1f436d58fcc6eec68e628948", "sha256": "98c4885e20174071ee712f63f73841372851ae1073a520cfb4878ce9ff959f37" }, "downloads": -1, "filename": "django-group-access-1.1.15.tar.gz", "has_sig": false, "md5_digest": "dccf121a1f436d58fcc6eec68e628948", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17766, "upload_time": "2013-06-26T15:47:07", "url": "https://files.pythonhosted.org/packages/5c/f8/63a1cff062b3959cbe55e98c1b36292a04a4873af8e4a69190fe4b93ffd8/django-group-access-1.1.15.tar.gz" } ], "1.1.16": [ { "comment_text": "", "digests": { "md5": "877a178c8ad8e92c48a51e2b4531950c", "sha256": "a362ae2b3648c882a2999b5320d7c0945fde3df3bdadd48ab066ac55d9b37694" }, "downloads": -1, "filename": "django-group-access-1.1.16.tar.gz", "has_sig": false, "md5_digest": "877a178c8ad8e92c48a51e2b4531950c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17438, "upload_time": "2013-10-08T08:21:15", "url": "https://files.pythonhosted.org/packages/8c/35/c32b4378bd218ce930233caabef66bc541fddac2c35dbb85ffc32320f36b/django-group-access-1.1.16.tar.gz" } ], "1.1.17": [ { "comment_text": "", "digests": { "md5": "d6c63c3c2b7f95af0e1951bbf3d3cd75", "sha256": "abccaeb0b581315430ff87cec1199e6c385836caee8eb8351c099a2c4f0b9e55" }, "downloads": -1, "filename": "django-group-access-1.1.17.tar.gz", "has_sig": false, "md5_digest": "d6c63c3c2b7f95af0e1951bbf3d3cd75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17775, "upload_time": "2014-01-13T16:22:11", "url": "https://files.pythonhosted.org/packages/ba/04/9d8db1442e96bd4dbd0b9f50c0d0b70d730411692e50cd4b79718c081798/django-group-access-1.1.17.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "001eea771ce3a2f74c82c4ee8390e7f8", "sha256": "4829525ba95a629c9759aadf3b018fe705ebb4698a3a9ddc437c8abb43a0df5a" }, "downloads": -1, "filename": "django-group-access-1.1.2.tar.gz", "has_sig": false, "md5_digest": "001eea771ce3a2f74c82c4ee8390e7f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15376, "upload_time": "2012-03-30T18:16:53", "url": "https://files.pythonhosted.org/packages/4b/bd/e6388ecfe5ca01d209d27452baf27b25f91407daf10452b97735519add64/django-group-access-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "2c6ea7c2de8651f28db32ed561ba800b", "sha256": "1a413aaa90e1c6fba4c0f69d34155675166e703b9f81b1128a0c3f2698caa19a" }, "downloads": -1, "filename": "django-group-access-1.1.3.tar.gz", "has_sig": false, "md5_digest": "2c6ea7c2de8651f28db32ed561ba800b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15388, "upload_time": "2012-04-04T18:46:53", "url": "https://files.pythonhosted.org/packages/e7/42/4c66ac168db2e31ae7974af941687d44f8e5d188cd81c5ae556b2f8cea5d/django-group-access-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "a4d61dc5155c0ebf45b01a489c9b9f6b", "sha256": "7a3d42583f343dd1fea34340d68777218af5669bcd35b42a23dec327c47a57d9" }, "downloads": -1, "filename": "django-group-access-1.1.4.tar.gz", "has_sig": false, "md5_digest": "a4d61dc5155c0ebf45b01a489c9b9f6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15671, "upload_time": "2012-04-26T16:49:31", "url": "https://files.pythonhosted.org/packages/34/16/d1a8bfcf6e317a46364c54bb078bedbdf4c522645ba8c30c1e21d5a6d9de/django-group-access-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "305a452c31c89ee6cd616d2aab615142", "sha256": "04a9ca0b57d27477861257b987018bfd306d0b41f26e13661cfea6190c1f1f9b" }, "downloads": -1, "filename": "django-group-access-1.1.5.tar.gz", "has_sig": false, "md5_digest": "305a452c31c89ee6cd616d2aab615142", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15674, "upload_time": "2012-04-26T16:50:33", "url": "https://files.pythonhosted.org/packages/a5/6f/5e72577a17ba8c8fe98acbc8f0c39ff14b76117aa2cfa79f033c462c43e4/django-group-access-1.1.5.tar.gz" } ], "1.1.8": [ { "comment_text": "", "digests": { "md5": "ef4a2fc604942a01f1b8164aacf03500", "sha256": "888e3bdf622ee564301bca7fae66b4e03ef391b4e2c77eea1105e30b592f096b" }, "downloads": -1, "filename": "django-group-access-1.1.8.tar.gz", "has_sig": false, "md5_digest": "ef4a2fc604942a01f1b8164aacf03500", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16065, "upload_time": "2012-07-20T12:55:53", "url": "https://files.pythonhosted.org/packages/2a/08/fd228636ab851fe4f9e090d9bc93e3c6a8e1b935df2f33c10625ca95148c/django-group-access-1.1.8.tar.gz" } ], "1.1.9": [ { "comment_text": "", "digests": { "md5": "e1a7fed514a71ad59c55ed6b7814f5f5", "sha256": "0ef2dd42fdf256634856cd1047d0dfd204cca76b18c408c974db238a8a513788" }, "downloads": -1, "filename": "django-group-access-1.1.9.tar.gz", "has_sig": false, "md5_digest": "e1a7fed514a71ad59c55ed6b7814f5f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16465, "upload_time": "2012-08-23T09:22:37", "url": "https://files.pythonhosted.org/packages/d3/4f/56ad1961670b2a1c851945c4b7f9e395b65e010cf82c1398c1c2bd366f4b/django-group-access-1.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d6c63c3c2b7f95af0e1951bbf3d3cd75", "sha256": "abccaeb0b581315430ff87cec1199e6c385836caee8eb8351c099a2c4f0b9e55" }, "downloads": -1, "filename": "django-group-access-1.1.17.tar.gz", "has_sig": false, "md5_digest": "d6c63c3c2b7f95af0e1951bbf3d3cd75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17775, "upload_time": "2014-01-13T16:22:11", "url": "https://files.pythonhosted.org/packages/ba/04/9d8db1442e96bd4dbd0b9f50c0d0b70d730411692e50cd4b79718c081798/django-group-access-1.1.17.tar.gz" } ] }