Questions tagged [yii2-user-roles]

Yii2-User-Roles

  1. Defining roles;
  2. Establishing relations among roles;
  3. Associating rules with roles;
  4. Assigning roles to users.
10 questions
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
1
vote
3 answers

How to hide admin account from other users

I am working on yii2. I have some user roles. Admin has all the level of access. Other users have a low level of access. There is a user list which is visible to the other user. In this list all of the details of the users in the system is…
Moeez
  • 537
  • 5
  • 33
  • 95
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
5 answers

To Get Role Of A User - Yii2

I was searching for user role for logged in user, I'm not getting how to print user role name. I Tried this: $Role = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()); When, I did print_r($Role); I got this : Array ( [superadmin] =>…
Nana Partykar
  • 10,175
  • 8
  • 43
  • 73
0
votes
1 answer

Yii2- How to restrict a user from viewing others data in index page

I am working on yii2 in my project, I have users and their roles. Each role is given access to a Module and a Sub Menu. There is a sub-menu named SIM List in which all the SIM records can be viewed. There is a field named issued_to which tells us…
Moeez
  • 537
  • 5
  • 33
  • 95
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
2 answers

User roles in Yii2, from DB value

This might sound duplicate at the first place but available answers lack clarity and doesnt solve my problem. i have a database list of users, one tuple would look something like the following. [ 'id' => '131', 'username' => 'mat', …
K3V
  • 374
  • 5
  • 15
0
votes
1 answer

Yii2 roles and users

Can I statically define roles in authManager (in defaultRoles array in config) and assign them to users so behavior rules define access to actions? As i have certain roles, I don't want to use auth_assignment and auth_item and ... Assuming I create…
Mehrdad
  • 13
  • 1
  • 3
0
votes
1 answer

MySQL grant privileges access denial

I have an Yii2 project, which operates some set of databases. It has one basic database connection where I keep users authentification data, and the second connection points to database automatically created for each user. I have to create databases…
Nastya Kizza
  • 362
  • 3
  • 13