add company-manager role
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use developeruz\db_rbac\interfaces\UserRbacInterface;
|
||||
use Yii;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
@ -23,7 +24,7 @@ use yii\web\UnauthorizedHttpException;
|
||||
* @property $access_token_expired_at
|
||||
* @property string $password write-only password
|
||||
*/
|
||||
class User extends ActiveRecord implements IdentityInterface
|
||||
class User extends ActiveRecord implements IdentityInterface, UserRbacInterface
|
||||
{
|
||||
const STATUS_DELETED = 0;
|
||||
const STATUS_ACTIVE = 10;
|
||||
@ -76,6 +77,11 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]);
|
||||
}
|
||||
|
||||
public function getUserName()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function generateAccessToken()
|
||||
{
|
||||
$this->access_token = Yii::$app->security->generateRandomString();
|
||||
|
Reference in New Issue
Block a user