{"id":19499699,"url":"https://github.com/apsl/django-object-authority","last_synced_at":"2026-05-13T08:31:07.468Z","repository":{"id":57421070,"uuid":"94522205","full_name":"APSL/django-object-authority","owner":"APSL","description":"Package to authorize actions (CRUD) to users over concrete items.","archived":false,"fork":false,"pushed_at":"2017-06-19T07:21:36.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T18:49:58.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/APSL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-16T08:20:28.000Z","updated_at":"2024-09-16T02:46:08.000Z","dependencies_parsed_at":"2022-09-13T14:20:25.081Z","dependency_job_id":null,"html_url":"https://github.com/APSL/django-object-authority","commit_stats":null,"previous_names":["bcanyelles/django-object-authority"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Fdjango-object-authority","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Fdjango-object-authority/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Fdjango-object-authority/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Fdjango-object-authority/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/APSL","download_url":"https://codeload.github.com/APSL/django-object-authority/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240746953,"owners_count":19850998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T22:05:52.375Z","updated_at":"2025-12-14T03:20:44.373Z","avatar_url":"https://github.com/APSL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django object authority\n\n**Package to authorize actions over concrete object instances.**\n\n[![travis-image]][travis]\n[![pypi-image]][pypi]\n[![docs-image]][docs]\n\n\n## Overview\n\nDjango provides an authentication system to authorize users to create, modify or delete models.\nThe user can perform this action on any element of the class in which it has such permissions.\nThis package extends these permissions and adds read permissions.\n\nThe main function of it is to control the access on specific elements for a concrete action.\n\n\n## Documentation\n\nOnline documentation is available at [http://django-object-authority.readthedocs.io](http://django-object-authority.readthedocs.io/en/latest/)\n\n\n## Features\n\n* New authentication backend for Django apps.\n* New authentication backend for Django rest framework.\n* Mechanism to auto-register object permissions.\n* Mixin to use in list views that filter your queryset according an authorization filter.\n* Per user permissions based filters.\n* Command to create custom permission of application and/or specific models.\n\n\n## Installation\n\nInstall using pip:\n\n    $ pip install django-object-authority\n\n## Setup\n\nAdd to INSTALLED_APPS\n```python\nINSTALLED_APPS = (\n    ...\n    'django_object_authority',\n)\n```\n\nAdd the new backend to AUTHENTICATION_BACKENDS\n```python\nAUTHENTICATION_BACKENDS = [\n    'django.contrib.auth.backends.ModelBackend',\n    'django_object_authority.backends.ObjectAuthorityBackend',\n]\n```\n\nRegister your object permissions\n\n```python\n# authorizations.py\n@register(SampleModel)\nclass SampleModelAuthority(ObjectAuthorization):\n\n    def has_object_permission(self, user, obj):\n        return obj.owner == user\n\n    def has_delete_permission(self, user, obj):\n        return obj.owner == user and not obj.is_editable\n```\n\n[travis-image]: https://secure.travis-ci.org/bcanyelles/django-object-authority.svg?branch=master\n[travis]: http://travis-ci.org/apsl/django-object-authority?branch=master\n[pypi-image]: https://img.shields.io/pypi/v/django-object-authority.svg\n[pypi]: https://pypi.python.org/pypi/django-object-authority\n[docs-image]: https://readthedocs.org/projects/docs/badge/?version=latest\n[docs]: http://django-object-authority.readthedocs.io/en/latest/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsl%2Fdjango-object-authority","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapsl%2Fdjango-object-authority","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsl%2Fdjango-object-authority/lists"}