|
@@ -108,18 +108,12 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
|
{
|
|
{
|
|
if (user.Policy.IsDisabled)
|
|
if (user.Policy.IsDisabled)
|
|
{
|
|
{
|
|
- throw new SecurityException("User account has been disabled.")
|
|
|
|
- {
|
|
|
|
- SecurityExceptionType = SecurityExceptionType.Unauthenticated
|
|
|
|
- };
|
|
|
|
|
|
+ throw new SecurityException("User account has been disabled.");
|
|
}
|
|
}
|
|
|
|
|
|
if (!user.Policy.EnableRemoteAccess && !_networkManager.IsInLocalNetwork(request.RemoteIp))
|
|
if (!user.Policy.EnableRemoteAccess && !_networkManager.IsInLocalNetwork(request.RemoteIp))
|
|
{
|
|
{
|
|
- throw new SecurityException("User account has been disabled.")
|
|
|
|
- {
|
|
|
|
- SecurityExceptionType = SecurityExceptionType.Unauthenticated
|
|
|
|
- };
|
|
|
|
|
|
+ throw new SecurityException("User account has been disabled.");
|
|
}
|
|
}
|
|
|
|
|
|
if (!user.Policy.IsAdministrator
|
|
if (!user.Policy.IsAdministrator
|
|
@@ -128,10 +122,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
|
{
|
|
{
|
|
request.Response.Headers.Add("X-Application-Error-Code", "ParentalControl");
|
|
request.Response.Headers.Add("X-Application-Error-Code", "ParentalControl");
|
|
|
|
|
|
- throw new SecurityException("This user account is not allowed access at this time.")
|
|
|
|
- {
|
|
|
|
- SecurityExceptionType = SecurityExceptionType.ParentalControl
|
|
|
|
- };
|
|
|
|
|
|
+ throw new SecurityException("This user account is not allowed access at this time.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -190,10 +181,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
|
{
|
|
{
|
|
if (user == null || !user.Policy.IsAdministrator)
|
|
if (user == null || !user.Policy.IsAdministrator)
|
|
{
|
|
{
|
|
- throw new SecurityException("User does not have admin access.")
|
|
|
|
- {
|
|
|
|
- SecurityExceptionType = SecurityExceptionType.Unauthenticated
|
|
|
|
- };
|
|
|
|
|
|
+ throw new SecurityException("User does not have admin access.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -201,10 +189,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
|
{
|
|
{
|
|
if (user == null || !user.Policy.EnableContentDeletion)
|
|
if (user == null || !user.Policy.EnableContentDeletion)
|
|
{
|
|
{
|
|
- throw new SecurityException("User does not have delete access.")
|
|
|
|
- {
|
|
|
|
- SecurityExceptionType = SecurityExceptionType.Unauthenticated
|
|
|
|
- };
|
|
|
|
|
|
+ throw new SecurityException("User does not have delete access.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -212,10 +197,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
|
{
|
|
{
|
|
if (user == null || !user.Policy.EnableContentDownloading)
|
|
if (user == null || !user.Policy.EnableContentDownloading)
|
|
{
|
|
{
|
|
- throw new SecurityException("User does not have download access.")
|
|
|
|
- {
|
|
|
|
- SecurityExceptionType = SecurityExceptionType.Unauthenticated
|
|
|
|
- };
|
|
|
|
|
|
+ throw new SecurityException("User does not have download access.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|