public void Authorize(UserAccountId account, object message) { var decider = GetDeciderForMessage(account); if (!decider.AreAllAllowed(_resolver.ResolvePermission(message))) { throw new SecurityException(string.Format("Yo bro, u do not have permission to do {0}", message.GetType())); } }
public void Authorize(UserId user, object message) { var decider = GetDeciderForMessage(user); if (!decider.AreAllAllowed(_resolver.ResolvePermission(message))) { throw new SecurityException(string.Format("Yo bro, u do not have permission to {0}", message.GetType().Name.ToLowerInvariant())); } }