feat: 用户管理后端与日志库迁移
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Frozen;
|
||||
using System.Linq;
|
||||
using TakeoutSaaS.Application.Identity.Contracts;
|
||||
|
||||
namespace TakeoutSaaS.Application.Identity;
|
||||
|
||||
internal static class IdentityUserAccess
|
||||
{
|
||||
private static readonly FrozenSet<string> SuperAdminRoleCodes = new[]
|
||||
{
|
||||
"super-admin",
|
||||
"SUPER_ADMIN",
|
||||
"PlatformAdmin",
|
||||
"platform-admin"
|
||||
}.ToFrozenSet(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
internal static bool IsSuperAdmin(CurrentUserProfile profile)
|
||||
=> profile.Roles.Any(role => SuperAdminRoleCodes.Contains(role));
|
||||
}
|
||||
Reference in New Issue
Block a user