M
M
My joy2021-05-06 19:44:42
PHP
My joy, 2021-05-06 19:44:42

Computed role in AccessControl?

Hi friends!

I have a permissions check in the controller:

[
    'allow' => true,
    'actions' => ['callcenter'],
    'roles' => ['admin',  'Operator', 'Dispatcher'],
],


And there is a function for checking special rights: User::isLeader()(returns bool)

How to add another rule to the list above, that if the f-th returns true, then access to this user is allowed regardless of his role.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gracer, 2018-10-16
@andrei2018

<option <?= $_SESSION['AAA'] ?>  value="CCC" >CCCCCCCCC</option>

error 1
p.2
foreach ($_POST['docs'] as $v ){
      $_SESSION[$v] = 'SELECTED';
      echo "SESSION['{$v}'] = ".$_SESSION[$v]."<br>";
    }

M
My joy, 2021-05-06
@t-alexashka

I decided. If anyone needs it:
We need to add another rule in this form:

[
    'allow' => User::isLeader(), // ф-я возвращающая true если доступ разрешен
    'actions' => ['callcenter'],
],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question