{"id":19553937,"url":"https://github.com/developeruz/easyii-rbac-module","last_synced_at":"2025-07-20T22:34:04.281Z","repository":{"id":56966476,"uuid":"80728468","full_name":"developeruz/easyii-rbac-module","owner":"developeruz","description":"Role Base Access for EasyiiCMS","archived":false,"fork":false,"pushed_at":"2017-02-03T16:53:51.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T21:33:46.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/developeruz.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":"2017-02-02T13:41:43.000Z","updated_at":"2018-07-25T08:36:31.000Z","dependencies_parsed_at":"2022-08-21T11:20:23.428Z","dependency_job_id":null,"html_url":"https://github.com/developeruz/easyii-rbac-module","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/developeruz/easyii-rbac-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeruz%2Feasyii-rbac-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeruz%2Feasyii-rbac-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeruz%2Feasyii-rbac-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeruz%2Feasyii-rbac-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developeruz","download_url":"https://codeload.github.com/developeruz/easyii-rbac-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeruz%2Feasyii-rbac-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266210835,"owners_count":23893337,"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-11T04:25:19.999Z","updated_at":"2025-07-20T22:34:04.265Z","avatar_url":"https://github.com/developeruz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Role Base Access for EasyiiCMS\n==============================\n\nThis module allows add [Rbac module](https://github.com/developeruz/yii2-db-rbac) to [Easy yii2 cms](http://github.com/noumo/easyii) \n\n## Installation guide\n\nPlease, install [User module for EasyiiCMS by following these instructions](https://github.com/developeruz/easyii-user-module) before going further\n\n```bash\n$ php composer.phar require developeruz/easyii-rbac-module \"dev-master\"\n```\n\nReplace last line in `app/config/web.php`\n```php\n$config = array_merge_recursive($config,\n    require($webroot . '/vendor/developeruz/easyii-user-module/config/user_module_config.php'),\n    require($webroot . '/vendor/noumo/easyii/config/easyii.php'));\n$config['components']['user'] = [ 'identityClass' =\u003e 'developeruz\\easyii_user\\models\\User' ];\nreturn $config;\n```\nwith \n```php\n$config = array_merge_recursive($config,\n    require($webroot . '/vendor/developeruz/easyii-user-module/config/user_module_config.php'),\n    require($webroot . '/vendor/developeruz/easyii-rbac-module/config/rbac_module_config.php'),\n    require($webroot . '/vendor/noumo/easyii/config/easyii.php'));\n$config['components']['user'] = [ 'identityClass' =\u003e 'developeruz\\easyii_rbac\\models\\User' ];\nreturn $config;\n```\n\nAdd authManager to components in `app/config/console.php` and `app/config/web.php`\n```php\n'components' =\u003e [\n      ...\n      'authManager' =\u003e [\n        'class' =\u003e 'yii\\rbac\\DbManager',\n      ],\n]\n```\n\nRun authManager migrations\n```bash \nphp yii migrate --migrationPath=@yii/rbac/migrations/\n```\n\nRun migrations\n```bash\nphp yii migrate --migrationPath=@vendor/developeruz/easyii-rbac-module/migrations\n```\n\nOpen User CRUD page (url `admin/user`), you will see `change user role` button in action buttons column. Click on it and assign `Admin`role to admin user.\n\nAdd behaviour in `app/config/web.php`\n```php\n'components' =\u003e [\n...\n],\n'modules' =\u003e [\n... \n],\n'as AccessBehavior' =\u003e [\n        'class' =\u003e \\developeruz\\db_rbac\\behaviors\\AccessBehavior::className(),\n        'login_url' =\u003e '/admin/sign/in',\n        'rules' =\u003e [\n            'user/security' =\u003e [['actions' =\u003e ['login'], 'allow' =\u003e true ],\n                                ['actions' =\u003e ['logout'], 'roles' =\u003e ['@'], 'allow' =\u003e true ]],\n            'user/settings' =\u003e [['roles' =\u003e ['@'], 'allow' =\u003e true ]],\n            'admin/sign' =\u003e [['actions' =\u003e ['in'], 'allow' =\u003e true],\n                             ['actions' =\u003e ['out'], 'roles' =\u003e ['@'], 'allow' =\u003e true ]],\n                             \n            'site' =\u003e[[ 'allow' =\u003e true]],\n            'articles' =\u003e[[ 'allow' =\u003e true]],\n            'gallery' =\u003e[[ 'allow' =\u003e true]],\n            'news' =\u003e[[ 'allow' =\u003e true]],\n        ],\n]\n\n```\n\nAdd all public controllers in `rules`.\n\nIf the user doesn't have access to admin panel, admin Toolbar will be hidden on front pages via adding css `display:none`. \nIt is compelled workaround because [Easy yii2 cms](http://github.com/noumo/easyii) doesn't allow to overwrite this part. \nI will create PR and change the behavior in this module as soon as it would be possible.\n\nLicense\n=======\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperuz%2Feasyii-rbac-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperuz%2Feasyii-rbac-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperuz%2Feasyii-rbac-module/lists"}