mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 05:27:30 +01:00
Nullify AuthenticationContextFactory
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Tgstation.Server.Host.Security
|
||||
/// <param name="systemIdentity">The value of <see cref="SystemIdentity"/>.</param>
|
||||
/// <param name="user">The value of <see cref="User"/>.</param>
|
||||
/// <param name="instanceUser">The value of <see cref="InstancePermissionSet"/>.</param>
|
||||
public void Initialize(ISystemIdentity systemIdentity, User user, InstancePermissionSet instanceUser)
|
||||
public void Initialize(ISystemIdentity? systemIdentity, User user, InstancePermissionSet? instanceUser)
|
||||
{
|
||||
this.user = user ?? throw new ArgumentNullException(nameof(user));
|
||||
if (systemIdentity == null && User.SystemIdentifier != null)
|
||||
|
||||
@@ -11,8 +11,6 @@ using Tgstation.Server.Host.Configuration;
|
||||
using Tgstation.Server.Host.Database;
|
||||
using Tgstation.Server.Host.Models;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Tgstation.Server.Host.Security
|
||||
{
|
||||
/// <inheritdoc cref="IAuthenticationContext" />
|
||||
@@ -99,7 +97,7 @@ namespace Tgstation.Server.Host.Security
|
||||
return currentAuthenticationContext;
|
||||
}
|
||||
|
||||
ISystemIdentity systemIdentity;
|
||||
ISystemIdentity? systemIdentity;
|
||||
if (user.SystemIdentifier != null)
|
||||
systemIdentity = identityCache.LoadCachedIdentity(user);
|
||||
else
|
||||
@@ -116,7 +114,7 @@ namespace Tgstation.Server.Host.Security
|
||||
var userPermissionSet = user.PermissionSet ?? user.Group.PermissionSet;
|
||||
try
|
||||
{
|
||||
InstancePermissionSet instancePermissionSet = null;
|
||||
InstancePermissionSet? instancePermissionSet = null;
|
||||
if (instanceId.HasValue)
|
||||
{
|
||||
instancePermissionSet = await databaseContext.InstancePermissionSets
|
||||
|
||||
Reference in New Issue
Block a user