mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-04-03 20:08:21 +00:00
WIP
This commit is contained in:
@@ -654,7 +654,7 @@ public partial class EpConnection : NetworkConnection, IStore
|
||||
{
|
||||
if (authPacket.Tdu != null)
|
||||
{
|
||||
var (_, parsed) = Codec.ParseSync(authPacket.Tdu.Value, Instance.Warehouse);
|
||||
var (_, parsed) = Codec.ParseSync(authPacket.Tdu.Value, null);
|
||||
|
||||
if (parsed is Map<byte, object> headers)
|
||||
{
|
||||
|
||||
@@ -44,8 +44,8 @@ public class UserPermissionsManager : IPermissionsManager
|
||||
{
|
||||
Map<string,object> userPermissions = null;
|
||||
|
||||
if (settings.ContainsKey(session.AuthorizedAccount))
|
||||
userPermissions = settings[session.AuthorizedAccount] as Map<string, object>;
|
||||
if (settings.ContainsKey(session.AuthorizedIdentity))
|
||||
userPermissions = settings[session.AuthorizedIdentity] as Map<string, object>;
|
||||
else if (settings.ContainsKey("public"))
|
||||
userPermissions = settings["public"] as Map<string,object>;
|
||||
else
|
||||
|
||||
@@ -119,10 +119,10 @@ public partial class MyService
|
||||
int MyPasscode = 2025;
|
||||
public PropertyContext<int> Passcode
|
||||
{
|
||||
get => new((sender) => sender.Session.AuthorizedAccount == "alice" ? MyPasscode : 0);
|
||||
get => new((sender) => sender.Session.AuthorizedIdentity == "alice" ? MyPasscode : 0);
|
||||
set
|
||||
{
|
||||
if (value.Connection.Session.AuthorizedAccount != "alice")
|
||||
if (value.Connection.Session.AuthorizedIdentity != "alice")
|
||||
throw new Exception("Only Alice is allowed.");
|
||||
MyPasscode = value.Value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user