Questions tagged [yii2-rbac]

Role-Based Access Control (RBAC) provides a simple yet powerful centralized access control.

Please refer to the Wikipedia for details about comparing RBAC with other more traditional access control schemes.

Yii implements a General Hierarchical RBAC, following the NIST RBAC model. It provides the RBAC functionality through the authManager application component.

39 questions
0
votes
1 answer

Yii2 - RBAC rule to allow/view own data

I have installed yii2mod/yii2-rbac from this url - https://github.com/yii2mod/yii2-rbac in yii2-basic. everything is working fine except using/allowing owner data. from this link:https://www.yiiframework.com/doc/guide/2.0/en/security-authorization I…
Joshi
  • 2,539
  • 5
  • 24
  • 53
0
votes
1 answer

yii2admin override Call to a member function getRoles() on null: authManager not read from config files

Error: Call to a member function getRoles() on null comes from: yii2-admin\models\searchs\AuthItem.php on line 75: public function search($params) { /* @var \yii\rbac\Manager $authManager */ $authManager = Configs::authManager(); if…
aalesund
  • 139
  • 3
  • 12
0
votes
1 answer

Yii2 RBAC Redis - whats wrong?

I`m tryind to use RBAC in my Yii2 advanced app (sweelix/yii2-redis-rbac and yiisoft/yii2-redis is installed). common/main.php: //.... 'components' => [ 'authManager' => [ 'class' => 'sweelix\rbac\redis\Manager', 'db' =>…
FeR-S
  • 191
  • 12
0
votes
1 answer

Yii2 Role swiching after login

A user has 3 roles. RoleOne RoleTwo RoleThree After Login I want to activate one of his roles active mode and rest of roles inactive mode. Does Yii2 have any role switching technique? Or we have to make our own logic. Here is how I am trying to…
Dharmendra Singh
  • 1,016
  • 12
  • 20
0
votes
1 answer

How to integrate Yeesoft/Yii2 cms RBAC (Role Based Access Control) with YII2 frontend RBAC?

I have been working with the yii2 advanced template and I am now wanting to implement some RBAC into my frontend project's controllers. I am very impressed with Yeesoft's/Yii2 cms RBAC control panel from https://github.com/yeesoft/yii2-yee-cms…
Addi
  • 165
  • 11
0
votes
2 answers

Yii2 auth_rule usage (Yii2 RBAC)

I am working with Yii2 basic templates and working on auth_manager. I have read about this at below link : Yii2 Authorization and i have check this also How can we use the auth_rule table in Yii2 RBAC? And now i know these things: how to assign…
0
votes
1 answer

Yii2 RBAC based on permissions

I am designing a system but I need to give the admin user the power to create roles and assign a set of permissions against them. Currently in the RBAC public function behaviors() { return [ 'access' => [ 'class' =>…
George Hallam
  • 41
  • 1
  • 4
0
votes
0 answers

How to allow an employee to login to system only if role has been assigned by admin in yii2?

I am using yii2 basic and have implemented RBAC using permissions, roles. I have Employee table and I have assigned Employee model to user application component. Now the scenario is when admin creates employee he has to assign a role to that…
Questions
  • 69
  • 1
  • 9
0
votes
1 answer

How to change menus on sidebar of Admin LTE as per roles in yii2?

I am using Yii2 basic. I have Employee table and I have assigned Employee model to user application component as follows in config file: 'user' => [ 'identityClass' => 'app\models\Employee', 'enableSession' => true, …
0
votes
1 answer

How to have working Admin LTE in yii2 basic application template

I am using yii2 basic application template. How to configure, install and have working admin lte?
Questions
  • 69
  • 1
  • 9
0
votes
1 answer

How to show records created by that users on index page in yii2?

I am using yii2 basic and implemented RBAC. I have two roles admin and fieldofficer and created permissions and rules and assigned users. Now when admin logs in, on index page he should be able to see all records as well as his created records in…
Questions
  • 69
  • 1
  • 9
0
votes
1 answer

How to authenticate admin and employee using identityclass in yii2

We can authenticate employees using identityclass feature provided in yii2. What if Admin is not an employee.? Can we have two identity class in config.php or how to implement such case?
Questions
  • 69
  • 1
  • 9
0
votes
1 answer

RBAC tables in yii2

How to create permissions, roles and rules in yii2 using gii? How to assign roles in yii2? How to implement all these using below 4 tables? auth_item auth_item_child auth_assignment auth_rule Consider the case: There are two users Admin and…
Questions
  • 69
  • 1
  • 9
0
votes
0 answers

Can't apply RBAC command

When I execute the command yii migrate --migrationPath=@yii/rbac/migrations inside the main folder to activate the RBAC following the guide in the here and returns the following error "Exception 'ReflectionException' with message "Class db does not…
changez
  • 77
  • 2
  • 10
0
votes
2 answers

Auth assignment database call yii2

I am using Yii2 and using the yii\rbac\DbManager for auth assignment. I was looking at the logs to see where all the database calls are coming from and this query SELECT `b`.* FROM `auth_assignment` `a`, `auth_item` `b` WHERE…
George Hallam
  • 41
  • 1
  • 4