{"id":41145387,"url":"https://github.com/alvan/acl","last_synced_at":"2026-01-22T18:55:12.972Z","repository":{"id":56946454,"uuid":"357490953","full_name":"alvan/acl","owner":"alvan","description":"Another ACL (Access Control List)","archived":false,"fork":false,"pushed_at":"2021-04-13T09:10:18.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-16T08:55:43.033Z","etag":null,"topics":["acl","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/alvan.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":"2021-04-13T09:09:06.000Z","updated_at":"2024-04-16T08:55:43.034Z","dependencies_parsed_at":"2022-08-21T02:40:29.284Z","dependency_job_id":null,"html_url":"https://github.com/alvan/acl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alvan/acl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Facl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Facl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Facl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Facl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvan","download_url":"https://codeload.github.com/alvan/acl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Facl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["acl","php"],"created_at":"2026-01-22T18:55:12.813Z","updated_at":"2026-01-22T18:55:12.960Z","avatar_url":"https://github.com/alvan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"About\n-----\n\nAnother ACL (Access Control List).\n\n\nUsage\n-----\n\n```php\n\n    $acl = new A\\Acl;\n    $acl-\u003esetComparer(new A\\Acl\\Comparer\\Location);\n    $acl-\u003esetDiscover(new class implements A\\Acl\\Discover\n    {\n        /**\n         * @param A\\Acl $assembly\n         * @param mixed $accessor\n         * @return A\\Acl\\Instance|null\n         */\n        public function discover(A\\Acl $assembly, $accessor) : ?A\\Acl\\Instance\n        {\n            $instance = null;\n    \n            if ($accessor)\n            {\n                $instance = $assembly-\u003ecreate();\n    \n                // Set default roles...\n                $instance-\u003eextend('guest');\n    \n                // Try to retrieve ACL rules from database or other sources by specified accessor ID...\n                // And then setup the acl instance...\n                // ...\n            }\n    \n            return $instance;\n        }\n    });\n    \n    $acl-\u003ecreate('admin')\n        -\u003epermit('.*')\n    ;\n    \n    $acl-\u003ecreate('guest')\n        -\u003eforbid('.*')\n        -\u003ehandle('admin/guess', function() : ?int {\n            return date('n') % 2;\n        })\n        -\u003epermit('admin/login')\n        -\u003epermit('index')\n    ;\n    \n    // int(1)\n    var_dump($acl-\u003eaccess('admin', 'admin/posts'));\n    \n    // int(0)\n    var_dump($acl-\u003eaccess('guest', 'admin/posts'));\n    \n    // int(1) if the \"month\" value is an odd number\n    var_dump($acl-\u003eaccess('guest', 'admin/guess'));\n    \n    // int(1)\n    var_dump($acl-\u003eaccess('guest', 'admin/login'));\n    \n    // int(1)\n    var_dump($acl-\u003eaccess('other', 'index/posts'));\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvan%2Facl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvan%2Facl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvan%2Facl/lists"}