:drunk: AI did something
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using MagicOnion;
|
||||
using MagicOnion.Server;
|
||||
using System.Text.Json;
|
||||
using DysonNetwork.Shared.Cache;
|
||||
using DysonNetwork.Shared.Models;
|
||||
using DysonNetwork.Shared.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NodaTime;
|
||||
|
||||
@@ -9,7 +12,7 @@ namespace DysonNetwork.Pass.Permission;
|
||||
public class PermissionService(
|
||||
AppDatabase db,
|
||||
ICacheService cache
|
||||
)
|
||||
) : ServiceBase<IPermissionService>, IPermissionService
|
||||
{
|
||||
private static readonly TimeSpan CacheExpiration = TimeSpan.FromMinutes(1);
|
||||
|
||||
@@ -195,4 +198,11 @@ public class PermissionService(
|
||||
Value = _SerializePermissionValue(value),
|
||||
};
|
||||
}
|
||||
|
||||
public async UnaryResult<bool> CheckPermission(string scope, string permission)
|
||||
{
|
||||
// Assuming the actor is always "user:current" for client-side checks
|
||||
// You might need to adjust this based on how your client identifies itself
|
||||
return await HasPermissionAsync("user:current", scope, permission);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user