如何使用Zend框架2获得用户角色?

I am using Zend Framework 2 and having trouble getting the user role. I am using zfc user and Zfc Rbac. The roles currently work however I would like to get the values to use in an if statement (in the controller). What is the function to call these? I have the developer tool turned on so I can see the role assigned but can't figure out out to call it.

Thanks Matt

I was used the below code and was able to get the role of the logged in user.

 $viewmodel = new ViewModel();
 $authorize = $this->getServiceLocator()->get('UserRbac\Identity\IdentityRoleProvider');
 $roles = $authorize->getIdentityRoles();
 echo $roles[0];
    $viewmodel->setVariable("roles", $roles);
return $viewmodel;

If you have setup you identify correctly in ZfcRbac, then you can use the authorization service (ZfcRbac\Service\AuthorizationService) to get the identity and its roles.

$authorizationService->getIdentity()->getRoles();