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.

42 questions
6
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' =>…
6
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
  • 1,339
  • 1
  • 19
  • 25
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
  • 14,947
  • 8
  • 32
  • 47
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
  • 986
  • 1
  • 18
  • 42
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…
Viacheslav
  • 76
  • 1
  • 6
1
vote
1 answer

Yii2 - Failed to instantiate component or class "yii\rbac\DBManager"

Im trying to set up my yii2 site on a linux server, and i use my windows pc for development using wampp. Ive set up RBAC AuthManagement to use DBManager, and everything works perfectly on my development site. However, when i try and install the site…
1
vote
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
  • 339
  • 8
  • 22
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,891
  • 5
  • 32
  • 50
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
  • 12
1
vote
2 answers

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…
Ninja Turtle
  • 1,293
  • 2
  • 24
  • 50
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
2 answers

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
  • 533
  • 3
  • 8
  • 22
0
votes
0 answers

Getting unknown property: Da\User\Module::isGuest yii2-usuario

I'm install 2amigos/yii2-usuario:~1.5.1 on a yii2-basic-template, using https://yii2-usuario.readthedocs.io/en/latest/. However, it returns this error (Getting unknown property: Da\User\Module::isGuest yii2-usuario) in any view. My…
0
votes
1 answer

Yii 2 Rule condition in RBAC

I am using Yii2 basic and RBAC. I have a scenario where admin creates various centers. Then admin create users and assigns the users to these centers. Each centers has multiple users. Now these users create different persons record and each users…
Questions
  • 69
  • 1
  • 12
0
votes
1 answer

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
  • 339
  • 8
  • 22
1
2 3