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
5
votes
1 answer

How to control visibility of buttons in ActionColumn of yii2 GridView when using yii2 RBAC with a rule class?

I understand the visibility of ActionColumn buttons can be controlled like this : $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' =>…
5
votes
1 answer

How to change/update user role? Yii2

I'm using yii2 role based access control (RBAC) system. I defined roles and permissions, defined rules, assigned roles to users. Everything works fine. but i want to update assigned roles to users. For…
devugur
  • 945
  • 1
  • 16
  • 23
5
votes
4 answers

Yii2 RBAC Rule Feedback / Message

This is a question about RBAC usage in Yii2. So far I have found it to work rather well and satisfactory, however there is one key feature that I am missing: The ability for Yii2 Rules to provide "feedback" in a similar way as Yii2 Validators set…
mae
  • 12,340
  • 8
  • 28
  • 40
3
votes
0 answers

showing user roles (rbac) in a searchable / sortable gridview column in yii2

I have a gridview widget which shows my user roles like so: $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ... [ 'header' => 'roles', …
natral
  • 775
  • 1
  • 12
  • 32
3
votes
3 answers

multiple user identity in config Yii2

I developing a site with two different registrations, and I have 2 different table, Im using RbacDB, and in the web config in the components section I have user configuration, according to this I want to know how I can use 2 different fields in the…
root_milka
  • 76
  • 1
  • 6
1
vote
1 answer

yii rbac acf multiple roles and params

So I have an action which I need multiple permissions to have access to. (for example manageUsers (admin) and manageCompanyUsers (company manager)) access behaviour in controller has rule like: 'allow' => true, 'actions' => ['index'], 'roles'…
Herokiller
  • 2,560
  • 5
  • 29
  • 48
1
vote
0 answers

How to change dashboard as per roles to employees in yii2?

I am using yii2 basic and Admin LTE I have Employee table and I have assigned Employee model to user application component and implemented RBAC. I have Dashboard Controller and view. 1. Now when admin logs in, and clicks on Dashboard menu, he can…
Questions
  • 69
  • 1
  • 9
1
vote
1 answer

How to update assignment in auth_assignment table in Yii2 Rbac?

I am using RBAC in my yii2 basic application to assign module to users based on their roles. I store role id and user_id in auth_assignment table. Now if i change role of user during update. I have to change it also in auth_assignment table. Now I…
Vinit Singh
  • 1,113
  • 2
  • 21
  • 45
1
vote
1 answer

How and where to create Yii2 Access Rules using mdmsoft/yii2-admin

Hi developers I am new to YII , I have installed the YII2 framework and want a RBAC I have installed mdmsoft/yii2-admin module , but I do not know how to create RULE class, where to create it and then how to use. When I create a role in admin…
1
vote
1 answer

Yii 2 - Exception error with message 'Login Required'

An Error occurred while handling another error: exception 'yii\web\ForbiddenHttpException' with message 'Login Required' in C:\wamp\www\k\kometonline\vendor\yiisoft\yii2\web\User.php:431 Am getting this error after installing RBAC in backend…
Kartz
  • 503
  • 3
  • 8
  • 20
0
votes
0 answers

mdmsoft/yii2-admin routes not working advanced template

i'm trying to implement mdmsoft/yii2-admin with advanced template with this pull request but when i try add route to menu get error "Route "x" not found." if i try force add route via database the menu show an empty array.
Moutinho
  • 321
  • 3
  • 14
0
votes
0 answers

Yii2 - dataProvider query filter RBAC based

What is the best way to do query with filters based on roles from RBAC. Objective: each user role see different results. It's good create a sequence of "ifs" or is there another good organization for this? Table auth_item: id | name …
Moutinho
  • 321
  • 3
  • 14
0
votes
2 answers

Yii mdmsoft get user ids who have access to specific route

am using mdmsoft / yii2-admin plugin is there any way to get user ids who has access/permission to specific route. I need to show only those user who can access the specific action in a dropdown. Before I was doing this but I want this dynamic…
Sourabh Shah
  • 100
  • 11
0
votes
0 answers

Why routes is empty in mdmsoft/yii2-admin?

I configured mdmsoft/yii2-admin in yii2 basic template but routes list is empty. why ? Confugrations 'modules' => [ ... 'admin' => [ 'class' => 'mdm\admin\Module', 'layout' => 'right-menu', // avaliable value 'left-menu',…
0
votes
0 answers

Yii2 rbac assigning roles and permissions

How I can use Rbac in the following scenario. for example - There are three locations and having Location Manager for each location. and each location then have two departments. Sales and production Sales department - Sales Manager, Sales…
Joshi
  • 2,539
  • 5
  • 24
  • 53
1
2 3