Identity/OrganizationSecurityIdentity.php
protected static function getOrganizationRoles(OrganizationInterface $organization, $roleHierarchy = null)
    {
        $roles = [];

        if ($organization instanceof RoleableInterface && $organization instanceof OrganizationInterface) {
            $roles = self::buildOrganizationRoles([], $organization);

            if ($roleHierarchy instanceof RoleHierarchyInterface) {
                $roles = RoleUtil::formatNames($roleHierarchy->getReachableRoles($roles));
            }
        }

        return $roles;
    }
protected static function getOrganizationRoles(OrganizationInterface $organization, $roleHierarchy = null)
    {
        $roles = [];

        if ($organization instanceof RoleableInterface && $organization instanceof OrganizationInterface) {
            $roles = self::buildOrganizationRoles([], $organization);

            if ($roleHierarchy instanceof RoleHierarchyInterface) {
                $roles = RoleUtil::formatNames($roleHierarchy->getReachableRoles($roles));
            }
        }

        return $roles;
    }
protected static function getOrganizationRoles ( OrganizationInterface $ organization , $ roleHierarchy = null ) { $ roles = [ ] ; if ( $ organization instanceof RoleableInterface && $ organization instanceof OrganizationInterface ) { $ roles = self :: buildOrganizationRoles ( [ ] , $ organization ) ; if ( $ roleHierarchy instanceof RoleHierarchyInterface ) { $ roles = RoleUtil :: formatNames ( $ roleHierarchy -> getReachableRoles ( $ roles ) ) ; } } return $ roles ; }
Get the organization roles.

@param OrganizationInterface       $organization  The organization
@param null|RoleHierarchyInterface $roleHierarchy The role hierarchy

@return string[]
Get the organization roles .