{"id":14966676,"url":"https://github.com/itstructure/yii2-rbac-module","last_synced_at":"2025-04-04T10:47:07.238Z","repository":{"id":56994584,"uuid":"133163638","full_name":"itstructure/yii2-rbac-module","owner":"itstructure","description":"Module to manage roles and permissions for the Yii2 Framework","archived":false,"fork":false,"pushed_at":"2023-01-30T13:42:11.000Z","size":98,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-10T13:40:21.063Z","etag":null,"topics":["module","rbac","yii2","yii2-framework","yii2-rbac"],"latest_commit_sha":null,"homepage":"https://pack-develop.info/en/product/rbac-yii2-module","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/itstructure.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2018-05-12T16:30:27.000Z","updated_at":"2023-01-30T13:42:09.000Z","dependencies_parsed_at":"2023-02-16T08:01:58.881Z","dependency_job_id":null,"html_url":"https://github.com/itstructure/yii2-rbac-module","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-rbac-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-rbac-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-rbac-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-rbac-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itstructure","download_url":"https://codeload.github.com/itstructure/yii2-rbac-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166138,"owners_count":20894652,"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":["module","rbac","yii2","yii2-framework","yii2-rbac"],"created_at":"2024-09-24T13:36:47.284Z","updated_at":"2025-04-04T10:47:07.213Z","avatar_url":"https://github.com/itstructure.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii2 RBAC module\n\n## Introduction\n\n[![Latest Stable Version](https://poser.pugx.org/itstructure/yii2-rbac-module/v/stable)](https://packagist.org/packages/itstructure/yii2-rbac-module)\n[![Latest Unstable Version](https://poser.pugx.org/itstructure/yii2-rbac-module/v/unstable)](https://packagist.org/packages/itstructure/yii2-rbac-module)\n[![License](https://poser.pugx.org/itstructure/yii2-rbac-module/license)](https://packagist.org/packages/itstructure/yii2-rbac-module)\n[![Total Downloads](https://poser.pugx.org/itstructure/yii2-rbac-module/downloads)](https://packagist.org/packages/itstructure/yii2-rbac-module)\n[![Build Status](https://scrutinizer-ci.com/g/itstructure/yii2-rbac-module/badges/build.png?b=master)](https://scrutinizer-ci.com/g/itstructure/yii2-rbac-module/build-status/master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/itstructure/yii2-rbac-module/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/itstructure/yii2-rbac-module/?branch=master)\n\n**RBAC module** - Module for the Yii2 framework, which provides management with the next data:\n- Roles\n- Permissions\n- Assign roles for users(profiles)\n\n![RBAC extension structure](https://github.com/itstructure/yii2-rbac-module/blob/master/yii2_rbac_structure_en.jpg)\n\n## Dependencies\n\n- php \u003e= 7.1\n- composer\n- MySql \u003e= 5.5\n\n## Installation\n\n### General from remote repository\n\nVia composer:\n\n`composer require itstructure/yii2-rbac-module \"~3.0.5\"`\n\n### If you are testing this package from local server directory\n\nIn application `composer.json` file set the repository, like in example:\n\n```json\n\"repositories\": [\n    {\n        \"type\": \"path\",\n        \"url\": \"../yii2-rbac-module\",\n        \"options\": {\n            \"symlink\": true\n        }\n    }\n],\n```\n\nHere,\n\n**yii2-rbac-module** - directory name, which has the same directory level like application and contains yii2 rbac module.\n\nThen run command:\n\n`composer require itstructure/yii2-rbac-module:dev-master --prefer-source`\n\n### Addition components\n\nIn accordance with the [documentation for Yii2](http://www.yiiframework.com/doc-2.0/guide-security-authorization.html), set **authManager** for application:\n\n```php\n'components' =\u003e [\n    'authManager' =\u003e [\n        'class' =\u003e 'yii\\rbac\\DbManager',\n    ],\n    // ...\n],\n```\n\nIn accordance with the [documentation for Yii2](http://www.yiiframework.com/doc-2.0/guide-security-authorization.html), run command:\n\n```php\nyii migrate --migrationPath=@yii/rbac/migrations\n```\n\n## Usage\n\n### Main properties\n\n- The **name** of module: `rbac`\n- The **namespace** for used classes: `Itstructure\\RbacModule`.\n- The **alias** to access in to module root directory: `@rbac`.\n\n- **There is not a layout !** It's taken from application layout **main** by default **or how it is configured**. You cat set `layout` attribute in module by custom.\n\n- **View** component is taken by default from the framework like **yii\\web\\View**. You cat set **view** component in module by custom.\n\n### Application config\nBase application config must be like in example below:\n\n```php\nuse Itstructure\\RbacModule\\Module;\nuse Itstructure\\RbacModule\\controllers\\{RoleController, PermissionController, ProfileController};\n```\n\n```php\n'modules' =\u003e [\n    'rbac' =\u003e [\n        'class' =\u003e Module::class,\n        'controllerMap' =\u003e [\n            'roles' =\u003e RoleController::class,\n            'permissions' =\u003e PermissionController::class,\n            'profiles' =\u003e ProfileController::class,\n        ],\n    ],\n],\n```\n\n### Useful module attributes\n\nYou can set the following attributes in a module config:\n\n- `loginUrl` - set url to be redirected if you are not authorized.\n- `accessRoles` - The roles of users who are allowed access to work with this package.\n- `urlPrefix` - Url prefix for redirect and view links (Default is empty).\n- `urlPrefixNeighbor` - Url prefix for redirect and view links of neighbor entity (Default is empty).\n\n## License\n\nCopyright © 2018-2023 Andrey Girnik girnikandrey@gmail.com.\n\nLicensed under the [MIT license](http://opensource.org/licenses/MIT). See LICENSE.txt for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitstructure%2Fyii2-rbac-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitstructure%2Fyii2-rbac-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitstructure%2Fyii2-rbac-module/lists"}