Ignore:
Timestamp:
Feb 16, 2023, 3:50:53 PM (21 months ago)
Author:
alloc
Message:

Latest state including reworking to the permissions system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/WebServer/src/WebConnection.cs

    r402 r404  
    33using System.Net;
    44using UnityEngine;
     5using Webserver.Permissions;
    56
    67namespace Webserver {
     
    1516                public IPAddress Endpoint { get; }
    1617
     18                public string Username { get; }
    1719                public PlatformUserIdentifierAbs UserId { get; }
     20                public PlatformUserIdentifierAbs CrossplatformUserId { get; }
    1821
    1922                public TimeSpan Age => DateTime.Now - lastAction;
    2023
    21                 public WebConnection (string _sessionId, IPAddress _endpoint, PlatformUserIdentifierAbs _userId) {
     24                public WebConnection (string _sessionId, IPAddress _endpoint, string _username, PlatformUserIdentifierAbs _userId, PlatformUserIdentifierAbs _crossUserId = null) {
    2225                        SessionID = _sessionId;
    2326                        Endpoint = _endpoint;
     27                        Username = _username;
    2428                        UserId = _userId;
     29                        CrossplatformUserId = _crossUserId;
    2530                        login = DateTime.Now;
    2631                        lastAction = login;
     
    2934
    3035                public static bool CanViewAllPlayers (int _permissionLevel) {
    31                         return WebPermissions.Instance.ModuleAllowedWithLevel ("webapi.viewallplayers", _permissionLevel);
     36                        return AdminWebModules.Instance.ModuleAllowedWithLevel ("webapi.viewallplayers", _permissionLevel);
    3237                }
    3338
    3439                public static bool CanViewAllClaims (int _permissionLevel) {
    35                         return WebPermissions.Instance.ModuleAllowedWithLevel ("webapi.viewallclaims", _permissionLevel);
     40                        return AdminWebModules.Instance.ModuleAllowedWithLevel ("webapi.viewallclaims", _permissionLevel);
    3641                }
    3742
Note: See TracChangeset for help on using the changeset viewer.