{ "info": { "author": "Bay Citizen & Texas Tribune", "author_email": "dev@armstrongcms.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "armstrong.core.arm_access\n=========================\nProvides a mechanism for restricting access to models inside Armstrong.\n\n\nUsage\n-----\nMake sure that ``armstrong.core.arm_content`` is installed in your\nenvironment and has been added to your ``INSTALLED_APPS``. You will also need\nto make sure the models have been installed in your database via ``armstrong\nsyncdb``. See the 'Restricting Content' and 'User Memberships' sections for more\ninformation.\n\n\n.. All of this sub-sections need to be moved out of the README into real docs\n\nRestricting Content\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nContent objects can have access restricted to certain levels by having them\ninherit from the ``armstrong.core.arm_access.mixins.AccessMixin`` class. This\nwill allow for the association of\n``armstrong.core.arm_access.models.Assignment``'s which specify levels that\ngrant access to that object for a specific time frame.\n\nFor the basic paywall scenario where some stories are always premium and others\nare always public, create two ``armstrong.core.arm_access.models.Level``'s. One\nwill be your premium level which will have ``is_protected`` set to ``True``\nwhile the other will be your public level which will have ``is_protected`` set\nto ``False``. When publishing an article, assign one of the two levels to the\ncontent.\n\nFor content which is premium for a period and then becomes public, create two\nlevels as before. Assign new content to the premium level with an\nimmediate ``start_date``, and also assign it to the public\nlevel with a ``start_date`` when you would like the content to become freely\navailable.\n\nTo restrict access to your archives to only premium subscribers you would add\ncontent to the public level with an immediate ``start_date`` and an\n``end_date`` of when you want to no longer offer free access. You will then\nneed to add the content to the premium level with an immediate ``start_date``\nand no ``end_date`` (which will default to ``datetime.datetime.max``).\n\nUser Memberships\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nUsers are granted access to Levels via\n``armstrong.core.arm_access.models.AccessMembership``'s. Each membership has a\n``start_date`` and ``end_date`` which defines the time frame for which the\nmembership is valid. Each memrbership also has an ``active`` boolean field\nwhich can be set to False to invalidate the membership. A user's active\nmemberships can be queried with ``user.access_memberships.current()``\n\nPaywalls\n\"\"\"\"\"\"\"\"\n\nThe actual process of preventing a user from accessing a piece of content is\nhandled via the paywalls in the ``armstrong.core.arm_access.paywalls`` package.\nCurrently the only provided paywall is\n``armstrong.core.arm_access.paywalls.subscription.SubscriptionPaywall`` which\nchecks for current memberships. The SubscriptionPaywall only works on a view\nwhich returns a TemplateResponse.\n\nTo use the SubscriptionPaywall in the demo app, you would use code like the\nfollowing::\n\n ...\n\n paywall = SubscriptionPaywall()\n protected_detail = paywall.protect(object_detail)\n\n ...\n\n url(r'^article/(?P[-\\w]+)/', protected_detail, {\n 'queryset':Article.published.all().select_subclasses(),\n 'template_name':'article.html',\n 'slug_field':'slug',\n },\n name='article_detail'),\n\nAn AccessDenied would be raised any time a user visited an article that was\nprotected with an access Level that they didn't have a membership for.\nSubscriptionPaywall takes an additional argument ``permission_denied`` that\ndetermines what action to take on failure. The argument must be a callable that\ntakes one argument, a TemplateResponse, and returns a Response object\nrepresenting what to do on access denied. For example::\n \n # to redirect to a new url entirely\n from armstrong.core.arm_access.paywalls import redirect_on_deny\n redirecting_paywall = SubscriptionPaywall(\n permission_denied=redirect_on_deny='/membership/signup')\n\n # to render the request's context with a new template (to provide teaser\n # content)\n from armstrong.core.arm_access.paywalls import render_on_deny\n rendering_paywall = SubscriptionPaywall(\n permission_denied=render_on_deny='/membership/upsell.html')\n\nIf you wanted to only render ads for users without a premium access level, you\ncould use the SubscriptionPaywall with a default template that doesn't render\nads and a render_on_deny that does.\n\nTo only allow an anonymous user a certain number of full article views and then\ndisplay the paywall, you would need to build a custom paywall implementation,\nbut the SubscriptionPaywall should provide a decent template. If you do\nimplement it, it would be an excellent candidate for inclusion in this package.\n\n\nInstallation & Configuration\n----------------------------\nYou can install the latest release of ``armstrong.core.arm_access`` using\n`pip`_:\n\n::\n\n pip install armstrong.core.arm_access\n\nMake sure to add ``armstrong.core.arm_access`` to your ``INSTALLED_APPS``. You\ncan add this however you like. This works as a copy-and-paste solution:\n\n::\n\n\tINSTALLED_APPS += [\"armstrong.core.arm_access\", ]\n\nOnce installed, you have to run either ``syncdb``, or ``migrate`` if you are\nusing `South`_.\n\n.. _pip: http://www.pip-installer.org/\n.. _South: http://south.aeracode.org/\n\n\nContributing\n------------\n\n* Create something awesome -- make the code better, add some functionality,\n whatever (this is the hardest part).\n* `Fork it`_\n* Create a topic branch to house your changes\n* Get all of your commits in the new topic branch\n* Submit a `pull request`_\n\n.. _pull request: http://help.github.com/pull-requests/\n.. _Fork it: http://help.github.com/forking/\n\n\nState of Project\n----------------\nArmstrong is an open-source news platform that is freely available to any\norganization. It is the result of a collaboration between the `Texas Tribune`_\nand `Bay Citizen`_, and a grant from the `John S. and James L. Knight\nFoundation`_.\n\nTo follow development, be sure to join the `Google Group`_.\n\n``armstrong.core.arm_access`` is part of the `Armstrong`_ project. You're\nprobably looking for that.\n\n.. _Texas Tribune: http://www.texastribune.org/\n.. _Bay Citizen: http://www.baycitizen.org/\n.. _John S. and James L. Knight Foundation: http://www.knightfoundation.org/\n.. _Google Group: http://groups.google.com/group/armstrongcms\n.. _Armstrong: http://www.armstrongcms.org/\n\n\nLicense\n-------\nCopyright 2011 Bay Citizen and Texas Tribune\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n", "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/armstrong/armstrong.core.arm_access/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "armstrong.core.arm_access", "package_url": "https://pypi.org/project/armstrong.core.arm_access/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/armstrong.core.arm_access/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/armstrong/armstrong.core.arm_access/" }, "release_url": "https://pypi.org/project/armstrong.core.arm_access/1.0.9/", "requires_dist": null, "requires_python": null, "summary": "Code for having different access levels for content", "version": "1.0.9" }, "last_serial": 828777, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "095d3d4a18f13f950924d0658fafad68", "sha256": "0cd26c16b078a09a0bc8c39a5fe47d3dd5607c5f041d759ec32d54d94fc60f99" }, "downloads": -1, "filename": "armstrong.core.arm_access-0.1.0.tar.gz", "has_sig": false, "md5_digest": "095d3d4a18f13f950924d0658fafad68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13852, "upload_time": "2011-08-22T21:51:13", "url": "https://files.pythonhosted.org/packages/eb/39/52a14afad434bcdf5c6cbedcc72b734660c71d58ae6415aca27d59597399/armstrong.core.arm_access-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3befde3881cc2f102b0649f60df8fedf", "sha256": "b0d5384504186136368e3a01d99d5b15aeb28138e93fb1dfbfe5e15cab3194e4" }, "downloads": -1, "filename": "armstrong.core.arm_access-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3befde3881cc2f102b0649f60df8fedf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13887, "upload_time": "2011-08-30T00:18:03", "url": "https://files.pythonhosted.org/packages/59/a8/1e0c701d3082e2a858fba426182635f933bb44ad324c91a39bf49ac76e01/armstrong.core.arm_access-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "70a2efc996c3763b39917477ae57b6bb", "sha256": "bc2ae6a807f2ee97733075ab7055173e70e3b34d81350f0ed680818f463bf054" }, "downloads": -1, "filename": "armstrong.core.arm_access-0.2.0.tar.gz", "has_sig": false, "md5_digest": "70a2efc996c3763b39917477ae57b6bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14196, "upload_time": "2011-09-29T23:31:22", "url": "https://files.pythonhosted.org/packages/82/b0/6a8aee2a3fdebed869d81fa0fd9931fca559604d2ca32b6a783512ec0703/armstrong.core.arm_access-0.2.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "6792f9463aa96d803297d5a59c039028", "sha256": "acf9dc9075e57b6ad13cc4c009e9a326e6a571e4b9810bcda50689e17595c685" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6792f9463aa96d803297d5a59c039028", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15336, "upload_time": "2011-09-30T23:37:48", "url": "https://files.pythonhosted.org/packages/02/50/393ad94fc4afe8f7d8d942c0fc1bfdd4c12a595155e176e7e0e69ba20466/armstrong.core.arm_access-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8004316b76ea0a4c6305b1cde4352db7", "sha256": "7acff079ca00b286b47619e37bc11c6f6ce1e27552e90bc9067c8106ac92853c" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8004316b76ea0a4c6305b1cde4352db7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15353, "upload_time": "2011-10-03T22:21:10", "url": "https://files.pythonhosted.org/packages/74/c2/286df8e0e30920a89e994119f921f066cef67d40036ad2e76128bbcbc9c3/armstrong.core.arm_access-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "527b243dc518367eba513c129c4f29d7", "sha256": "dff16f43ebc649e123d51eb58b6b9d6ce038ab6091b494091c1f1909848b8a4d" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.2.tar.gz", "has_sig": false, "md5_digest": "527b243dc518367eba513c129c4f29d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15587, "upload_time": "2011-10-19T23:54:52", "url": "https://files.pythonhosted.org/packages/02/e7/8c4239e81c2bd9e4bd2319906a5842b377a5313b8d16fd042a890f881d6f/armstrong.core.arm_access-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a72528dd7a8fd51b2219ee848313aa0c", "sha256": "88c638bdb5b045a89f9ab386dd1ecef20cde9db9e6823fe38795655d442271a3" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a72528dd7a8fd51b2219ee848313aa0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15590, "upload_time": "2011-12-20T22:26:21", "url": "https://files.pythonhosted.org/packages/89/75/99f8346479fd6787ede65f13abd9388fb113790a5cff920fea4f9d0790db/armstrong.core.arm_access-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "8f47e482b9628bd5f08cdc0eb6d30540", "sha256": "2b747224b75e73fa511a55bee4e4fb04d7e2a892a6e8f3d8ec4e445cfdae6d46" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.4.tar.gz", "has_sig": false, "md5_digest": "8f47e482b9628bd5f08cdc0eb6d30540", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15637, "upload_time": "2012-01-19T00:27:19", "url": "https://files.pythonhosted.org/packages/60/b4/5b9f65748007f1dec4cff037ae716c6ec859727a1002f2f531e26aca030d/armstrong.core.arm_access-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "e053dc180a088481870fc6cea4d3b1c8", "sha256": "aaa2deda3e21ab7bdff7271363e7b91df10fcc7773a39213be37b0fe5121ee54" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.5.tar.gz", "has_sig": false, "md5_digest": "e053dc180a088481870fc6cea4d3b1c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15854, "upload_time": "2012-01-21T00:22:31", "url": "https://files.pythonhosted.org/packages/af/01/d84823433779c788f6593f2a8dfa7fe6bd917e5669ebcfe619a85d139b92/armstrong.core.arm_access-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "52c0b885f9204ea75ccd4dde90429b08", "sha256": "18bde6adc9b50f27b0355b72aa9111cb5217c08ddcc00650503c66f7efc64ab2" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.6.tar.gz", "has_sig": false, "md5_digest": "52c0b885f9204ea75ccd4dde90429b08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16086, "upload_time": "2012-03-29T23:01:23", "url": "https://files.pythonhosted.org/packages/04/3b/3494949dfb122985cc3741a0c3fc096d928f2785f4ac0fe30316e278b962/armstrong.core.arm_access-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "9fa003f6be1c63cc3f98db0e66eb74e8", "sha256": "b06d0405f70b12c20c7d02b76bbcb55b2a2f1e5b9fb80983ebb2b1b4845f7a91" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.7.tar.gz", "has_sig": false, "md5_digest": "9fa003f6be1c63cc3f98db0e66eb74e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16101, "upload_time": "2012-05-19T00:26:16", "url": "https://files.pythonhosted.org/packages/08/4d/56ab5f21b4ad8a3a1b863ebf410b7ee88c2889c61339b6068be67e670f59/armstrong.core.arm_access-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "5e40df2f15a005fc43e211624d5a197c", "sha256": "34d5b68c5e0a697d81d0871b74d663cb7c6fb4301fac9903e19b42184b2eba2c" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.8.tar.gz", "has_sig": false, "md5_digest": "5e40df2f15a005fc43e211624d5a197c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16113, "upload_time": "2013-01-23T20:33:39", "url": "https://files.pythonhosted.org/packages/8f/db/750048b15f73e66a60128690ccf31c256e253d49ecab7865f422198f0c20/armstrong.core.arm_access-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "5e42d633116b485a1a3f660b2006fa70", "sha256": "00545e87d9eaeca8bce1563b61492bde0943f7a1f30eaee539cc9d5f0affcccf" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.9.tar.gz", "has_sig": false, "md5_digest": "5e42d633116b485a1a3f660b2006fa70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16109, "upload_time": "2013-02-20T22:44:46", "url": "https://files.pythonhosted.org/packages/2d/bf/2c46dbbd11b6766d36b4bf855aaa9d9ad0e161c42e28759a2e1bc4e0b3c4/armstrong.core.arm_access-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5e42d633116b485a1a3f660b2006fa70", "sha256": "00545e87d9eaeca8bce1563b61492bde0943f7a1f30eaee539cc9d5f0affcccf" }, "downloads": -1, "filename": "armstrong.core.arm_access-1.0.9.tar.gz", "has_sig": false, "md5_digest": "5e42d633116b485a1a3f660b2006fa70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16109, "upload_time": "2013-02-20T22:44:46", "url": "https://files.pythonhosted.org/packages/2d/bf/2c46dbbd11b6766d36b4bf855aaa9d9ad0e161c42e28759a2e1bc4e0b3c4/armstrong.core.arm_access-1.0.9.tar.gz" } ] }