yii\rbac\ManagerInterface::getUserIdsByRole PHP 메소드

getUserIdsByRole() 공개 메소드

Returns all user IDs assigned to the role specified.
부터: 2.0.7
public getUserIdsByRole ( string $roleName ) : array
$roleName string
리턴 array array of user ID strings
    public function getUserIdsByRole($roleName);

Usage Example

 public function testGetAssignmentsByRole()
 {
     $this->prepareData();
     $reader = $this->auth->getRole('reader');
     $this->auth->assign($reader, 123);
     $this->auth = $this->createManager();
     $this->assertEquals([], $this->auth->getUserIdsByRole('nonexisting'));
     $this->assertEquals(['reader A', '123'], $this->auth->getUserIdsByRole('reader'));
     $this->assertEquals(['author B'], $this->auth->getUserIdsByRole('author'));
     $this->assertEquals(['admin C'], $this->auth->getUserIdsByRole('admin'));
 }
All Usage Examples Of yii\rbac\ManagerInterface::getUserIdsByRole