{"id":20876063,"url":"https://github.com/php-casbin/medoo-adapter","last_synced_at":"2025-05-12T15:32:02.082Z","repository":{"id":46708003,"uuid":"207269617","full_name":"php-casbin/medoo-adapter","owner":"php-casbin","description":"Medoo Adapter for PHP-Casbin, Casbin is a powerful and efficient open-source access control library.","archived":false,"fork":false,"pushed_at":"2024-10-29T16:16:18.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-20T20:50:37.772Z","etag":null,"topics":["abac","access-control","acl","casbin","medoo","permissions","rbac","restful","security"],"latest_commit_sha":null,"homepage":"https://github.com/php-casbin/php-casbin","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-casbin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-09T09:11:04.000Z","updated_at":"2024-10-29T16:14:58.000Z","dependencies_parsed_at":"2024-11-18T06:50:10.905Z","dependency_job_id":"80743987-4ee8-4360-89e5-79a43ebfe40c","html_url":"https://github.com/php-casbin/medoo-adapter","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"77f644dde53a093bc364e1e216740b2baebb3246"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-casbin%2Fmedoo-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-casbin%2Fmedoo-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-casbin%2Fmedoo-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-casbin%2Fmedoo-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-casbin","download_url":"https://codeload.github.com/php-casbin/medoo-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253765943,"owners_count":21960821,"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":["abac","access-control","acl","casbin","medoo","permissions","rbac","restful","security"],"created_at":"2024-11-18T06:49:55.541Z","updated_at":"2025-05-12T15:32:01.368Z","avatar_url":"https://github.com/php-casbin.png","language":"PHP","readme":"# Medoo Adapter for Casbin\n\n[![Build Status](https://github.com/php-casbin/medoo-adapter/actions/workflows/build.yml/badge.svg)](https://github.com/php-casbin/medoo-adapter/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/php-casbin/medoo-adapter/badge.svg)](https://coveralls.io/github/php-casbin/medoo-adapter)\n[![Latest Stable Version](https://poser.pugx.org/casbin/medoo-adapter/v/stable)](https://packagist.org/packages/casbin/medoo-adapter)\n[![Total Downloads](https://poser.pugx.org/casbin/medoo-adapter/downloads)](https://packagist.org/packages/casbin/medoo-adapter)\n[![License](https://poser.pugx.org/casbin/medoo-adapter/license)](https://packagist.org/packages/casbin/medoo-adapter)\n\n[Medoo](https://github.com/catfan/Medoo) Adapter for [PHP-Casbin](https://github.com/php-casbin/php-casbin), [Casbin](https://casbin.org/) is a powerful and efficient open-source access control library.\n\n`Medoo` is a lightweight PHP Database Framework to Accelerate Development, supports all SQL databases, including `MySQL`, `MSSQL`, `SQLite`, `MariaDB`, `PostgreSQL`, `Sybase`, `Oracle` and more.\n\n### Installation\n\nVia [Composer](https://getcomposer.org/).\n\n```\ncomposer require casbin/medoo-adapter\n```\n\n### Usage\n\n```php\n\nrequire_once './vendor/autoload.php';\n\nuse Casbin\\Enforcer;\nuse CasbinAdapter\\Medoo\\Adapter as DatabaseAdapter;\n\n$config = [\n    'database_type' =\u003e 'mysql',\n    'server' =\u003e '127.0.0.1',\n    'database_name' =\u003e 'test',\n    'username' =\u003e 'root',\n    'password' =\u003e '',\n    'port' =\u003e '3306',\n];\n\n$adapter = DatabaseAdapter::newAdapter($config);\n\n$e = new Enforcer('path/to/model.conf', $adapter);\n\n$sub = \"alice\"; // the user that wants to access a resource.\n$obj = \"data1\"; // the resource that is going to be accessed.\n$act = \"read\"; // the operation that the user performs on the resource.\n\nif ($e-\u003eenforce($sub, $obj, $act) === true) {\n    // permit alice to read data1\n} else {\n    // deny the request, show an error\n}\n```\n\n### Getting Help\n\n- [php-casbin](https://github.com/php-casbin/php-casbin)\n\n### License\n\nThis project is licensed under the [Apache 2.0 license](LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-casbin%2Fmedoo-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-casbin%2Fmedoo-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-casbin%2Fmedoo-adapter/lists"}