{"id":19183918,"url":"https://github.com/zero-shubham/permissions_system","last_synced_at":"2025-10-30T03:40:24.671Z","repository":{"id":39827850,"uuid":"260601290","full_name":"zero-shubham/permissions_system","owner":"zero-shubham","description":"An alternative to admin utilities for more autonomy and control.","archived":false,"fork":false,"pushed_at":"2022-12-08T10:11:51.000Z","size":316,"stargazers_count":5,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-16T09:40:21.058Z","etag":null,"topics":["fastapi-admin","flask-admin","react-admin"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/permissions-system/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zero-shubham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-02T02:47:16.000Z","updated_at":"2024-02-26T04:01:51.000Z","dependencies_parsed_at":"2023-01-24T23:45:15.898Z","dependency_job_id":null,"html_url":"https://github.com/zero-shubham/permissions_system","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zero-shubham/permissions_system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-shubham%2Fpermissions_system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-shubham%2Fpermissions_system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-shubham%2Fpermissions_system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-shubham%2Fpermissions_system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zero-shubham","download_url":"https://codeload.github.com/zero-shubham/permissions_system/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-shubham%2Fpermissions_system/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266897218,"owners_count":24002642,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fastapi-admin","flask-admin","react-admin"],"created_at":"2024-11-09T11:05:33.116Z","updated_at":"2025-10-30T03:40:19.638Z","avatar_url":"https://github.com/zero-shubham.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Permissions Systems\n\n##### _It's plugin for ~~fastapi (but can be used with similar frameworks)~~ any frameworks, that provides a minimal_\n\n##### _setup for maintaining resources and related permissions for user-groups._\n\n#### How to use it?\n\n**application.py**\n\n```python\nfrom fastapi import FastAPI\nimport databases\nimport sqlalchemy\nimport os\nfrom permissions_system.PermissionsSystemDatabases import PermissionsS\n\napp = FastAPI()\n\nDB_URI = os.environ[\"DB_URI\"]\n\ndatabase = databases.Database(DB_URI)\nmetadata = sqlalchemy.MetaData()\nps = PermissionsS(metadata, database, DB_URI)\n\n\napp.add_event_handler(\"startup\", startup)\napp.add_event_handler(\"shutdown\", shutdown)\n\nasync def startup():\n    await database.connect()\n    ps.setup()\n```\n\n\u003e for Flask app you will call ps.setup() after db.init(app), assuming you are using flask_sqlalchemy\n\n_Step1 -_ **instantiate PermissionsS class.**\n\n_Step2 -_ **during startup event after database is connected make a call to setup()**\n_********\\*\\*\\*\\*********\\*\\*\\*\\*********\\*\\*\\*\\*********\\_********\\*\\*\\*\\*********\\*\\*\\*\\*********\\*\\*\\*\\*********_\n\n**\\_PermissionsS will then detect your tables add them to resources, add super-admin user-group, if there isn't already one. Everytime there is a new resource that gets added automatically to resources table. User-group super-admin by default has all CRUD permissions for all resources. To add a new user-group and related permissions use built-in functions add_user_group and add_permissions. To get whether a particular user has CRUD permissions for a particular resource you will call**\n**\u003e ps.user_has_permissions(user_id:UUID,resource:str,permission_type:PermissionTypesEnum) -\u003e bool\\***\n\n_PermissionsSystem is not like django-admin or flask-admin. It doesn't provide a front-end admin dashboard, but a minimal setup to manage resources and permissions. It aims to provide autonomy and more control over to the developer. For front-end you will end up using something more custom or [React-admin](https://marmelab.com/react-admin/) or [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)_\n\n**Find an example [here](https://github.com/zero-shubham/permissions_system_example), to learn how it can be used.**\n\n## PermissionsSystem now only uses sqlalchemy and is completely sync.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-shubham%2Fpermissions_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzero-shubham%2Fpermissions_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-shubham%2Fpermissions_system/lists"}