{ "info": { "author": "Joel Cox", "author_email": "joel@joelcox.nl", "bugtrack_url": null, "classifiers": [], "description": "Moat\n====\n\nA simple authorization API for Python.\n\nExample\n-------\n\nFirst, mix the UserMixin and ResourceMixin with your User class and the\nresources you want to provide authorization for.\n\n.. code-block:: python\n\n from moat import ResourceMixin, UserMixin\n\n class Post(ResourceMixin):\n\n def type(self):\n return self.__class__.__name__\n\n def identifier(self):\n return self.id\n\n\n class User(UserMixin):\n\n def identifier(self):\n return self.id\n\nNow implement the methods specified in the base Repository class to retrieve\nthe permissions from the datastore. Pass in an instance of the repository\nto the main Moat class.\n\nNow you can check whether a user is actually authorized to do certain things:\n\n.. code-block:: python\n\n from moat import Moat, Permissions\n from moat.repositories import MockRepository\n\n moat = Moat(MockRepository())\n\n # Now you can check if a user has a specific permission for a certain object.\n moat.has(Permission.read, user, post)\n moat.has(Permission.write, user, post)\n\n # Remove the permission\n moat.remove(Permission.write, user, post)\n\n # Set the permission, again\n moat.set(Permission.write, user, post)\n\n # Or get all the ids of type of resources the user has permissions for\n moat.all(Permission.read, user, Post)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/moat/", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "moat", "package_url": "https://pypi.org/project/moat/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/moat/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/moat/" }, "release_url": "https://pypi.org/project/moat/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A simple authorization API for Python.", "version": "0.1.0" }, "last_serial": 1132651, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "100b6ebdc73b8282e6d48d87e873c32a", "sha256": "efd8762eceda8e698fd3178d6ed5ebb895a797dbc820acb9c0ab2001c87effc9" }, "downloads": -1, "filename": "moat-0.1.0.tar.gz", "has_sig": false, "md5_digest": "100b6ebdc73b8282e6d48d87e873c32a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2603, "upload_time": "2014-06-21T11:00:55", "url": "https://files.pythonhosted.org/packages/ef/39/f887aeace7b34b2231151f8bfdcf4f6f156554fbc19e2c5532d9cf38df04/moat-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "100b6ebdc73b8282e6d48d87e873c32a", "sha256": "efd8762eceda8e698fd3178d6ed5ebb895a797dbc820acb9c0ab2001c87effc9" }, "downloads": -1, "filename": "moat-0.1.0.tar.gz", "has_sig": false, "md5_digest": "100b6ebdc73b8282e6d48d87e873c32a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2603, "upload_time": "2014-06-21T11:00:55", "url": "https://files.pythonhosted.org/packages/ef/39/f887aeace7b34b2231151f8bfdcf4f6f156554fbc19e2c5532d9cf38df04/moat-0.1.0.tar.gz" } ] }