mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
start using user policy
This commit is contained in:
parent
e55ab989d2
commit
8807e80d0a
66 changed files with 546 additions and 323 deletions
|
|
@ -206,8 +206,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
HostContext.Config.HandlerFactoryPath = ListenerRequest.GetHandlerPathIfAny(UrlPrefixes.First());
|
||||
|
||||
_listener = _supportsNativeWebSocket && NativeWebSocket.IsSupported
|
||||
? _listener = new HttpListenerServer(_logger, OnRequestReceived)
|
||||
//? _listener = new WebSocketSharpListener(_logger, OnRequestReceived)
|
||||
//? _listener = new HttpListenerServer(_logger, OnRequestReceived)
|
||||
? _listener = new WebSocketSharpListener(_logger, OnRequestReceived)
|
||||
: _listener = new WebSocketSharpListener(_logger, OnRequestReceived);
|
||||
|
||||
_listener.WebSocketHandler = WebSocketHandler;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
|||
|
||||
if (user != null)
|
||||
{
|
||||
if (user.Configuration.IsDisabled)
|
||||
if (user.Policy.IsDisabled)
|
||||
{
|
||||
throw new SecurityException("User account has been disabled.")
|
||||
{
|
||||
|
|
@ -76,7 +76,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
|||
};
|
||||
}
|
||||
|
||||
if (!user.Configuration.IsAdministrator &&
|
||||
if (!user.Policy.IsAdministrator &&
|
||||
!authAttribtues.EscapeParentalControl &&
|
||||
!user.IsParentalScheduleAllowed())
|
||||
{
|
||||
|
|
@ -135,7 +135,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
|||
{
|
||||
if (roles.Contains("admin", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
if (user == null || !user.Configuration.IsAdministrator)
|
||||
if (user == null || !user.Policy.IsAdministrator)
|
||||
{
|
||||
throw new SecurityException("User does not have admin access.")
|
||||
{
|
||||
|
|
@ -145,7 +145,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
|||
}
|
||||
if (roles.Contains("delete", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
if (user == null || !user.Configuration.EnableContentDeletion)
|
||||
if (user == null || !user.Policy.EnableContentDeletion)
|
||||
{
|
||||
throw new SecurityException("User does not have delete access.")
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue