public Yield GetBan(DreamContext context, DreamMessage request, Result <DreamMessage> response) { PermissionsBL.CheckUserAllowed(DekiContext.Current.User, Permissions.ADMIN); BanBE ban = GetBanFromRequest(context, context.GetParam <uint>("banid")); response.Return(DreamMessage.Ok(BanningBL.GetBanXml(ban))); yield break; }
public Yield PostBans(DreamContext context, DreamMessage request, Result <DreamMessage> response) { PermissionsBL.CheckUserAllowed(DekiContext.Current.User, Permissions.ADMIN); BanBE ban = BanningBL.SaveBan(request.ToDocument()); DekiContext.Current.Instance.EventSink.BanCreated(DekiContext.Current.Now, ban); response.Return(DreamMessage.Ok(BanningBL.GetBanXml(ban))); yield break; }