✨ Wallet, payment, developer apps, feature flags of publishers
♻️ Simplified the permission check of chat room, realm, publishers
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using DysonNetwork.Sphere.Account;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DysonNetwork.Sphere.Realm;
|
||||
|
||||
@ -9,4 +10,11 @@ public class RealmService(AppDatabase db, NotificationService nty)
|
||||
await nty.SendNotification(member.Account, "invites.realms", "New Realm Invitation", null,
|
||||
$"You just got invited to join {member.Realm.Name}");
|
||||
}
|
||||
|
||||
public async Task<bool> IsMemberWithRole(Guid realmId, Guid accountId, RealmMemberRole requiredRole)
|
||||
{
|
||||
var member = await db.RealmMembers
|
||||
.FirstOrDefaultAsync(m => m.RealmId == realmId && m.AccountId == accountId);
|
||||
return member?.Role >= requiredRole;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user