@ -273,29 +273,31 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get ( GetPublicUsers request )
{
var use rs = _userManager
var re sult = _userManager
. Users
. Where ( item = > ! item . Policy . IsDisabled )
. Where ( item = > ! item . Policy . IsHidden ) ;
. Where ( item = > ! item . Policy . IsDisabled ) ;
if ( ServerConfigurationManager . Configuration . IsStartupWizardCompleted )
{
var deviceId = _authContext . GetAuthorizationInfo ( Request ) . DeviceId ;
result = result . Where ( item = > ! item . Policy . IsHidden ) ;
if ( ! string . IsNullOrWhiteSpace ( deviceId ) )
{
users = users . Where ( i = > _deviceManager . CanAccessDevice ( i , deviceId ) ) ;
result = result . Where ( i = > _deviceManager . CanAccessDevice ( i , deviceId ) ) ;
}
if ( ! _networkManager . IsInLocalNetwork ( Request . RemoteIp ) )
{
users = users . Where ( i = > i . Policy . EnableRemoteAccess ) ;
result = result . Where ( i = > i . Policy . EnableRemoteAccess ) ;
}
}
var result = users
return ToOptimizedResult ( result
. OrderBy ( u = > u . Name )
. Select ( i = > _userManager . GetPublicUserDto ( i , Request . RemoteIp ) )
. ToArray ( ) ;
return ToOptimizedResult ( result ) ;
. ToArray ( )
) ;
}
/// <summary>