public void ModAction(string subreddit, Models.ModAction action) { action.Subreddit = subreddit; if (User.IsInRole(subreddit.ToLower())) { action.Mod = User.Identity.Name; Signalr.SnooNoteUpdates.Instance.SendModAction(action); } else { throw new UnauthorizedAccessException("You are not a moderator of that subreddit!"); } }
public void ModAction([FromRoute] string subreddit, [FromBody] Models.ModAction act) { act.Subreddit = subreddit; if (User.IsInRole(subreddit.ToLower())) { act.Mod = User.Identity.Name; snooNoteUpdates.SendModAction(act); } else { throw new UnauthorizedAccessException("You are not a moderator of that subreddit!"); } }
public void SendModAction(Models.ModAction action) { connManager.GetHubContext <SnooNotesHub>().Clients.Group(action.Subreddit.ToLower()).modAction(action.ThingID, action.Mod, action.Action); }
public void SendModAction(Models.ModAction action) { Clients.Group(action.Subreddit.ToLower()).modAction(action.ThingID, action.Mod, action.Action); }