L
L
Leopandro2016-01-05 20:25:13
Yii
Leopandro, 2016-01-05 20:25:13

How does the getIsAdmin function work?

Met in dektrium/yii2-user code

public function getIsAdmin()
    {
        return in_array($this->username, $this->module->admins);
    }

they say that there is some kind of superuser field, but it is not in the database.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2016-01-05
@kawabanga

Nevertheless, the documentation is, initially it is assumed that you will enter an array in the settings in the web.php of the module.
https://github.com/dektrium/yii2-user/blob/master/... (admins)
https://github.com/dektrium/yii2-user/blob/master/...
But sometimes it's more convenient rewrite the rules for accessing the adminController controller of this module in order to distribute rights more flexibly, based on your RBAC system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question