 
     {:ok, method_caller}
   end
+
+  def call_plugin(context, id, method, params) do
+    if has_perm_for_plugin(context, id) do
+      Plugin.Runner.call id, method, params
+    else
+      {:error, :unknown_method}
+    end
+  end
 end

defmodule Serverboards.Plugin.RPC do
  alias MOM.RPC
  alias Serverboards.Plugin

  def has_perm_for_plugin(context, plugin) do
    perms = RPC.Context.get(context, :user).perms


    RPC.MethodCaller.add_method method_caller, "plugin.call", fn
      [id, method, params] ->
        call_plugin(context, id, method, params)
      [id, method] ->
        call_plugin(context, id, method, [])
    end, [context: true]

    RPC.MethodCaller.add_method method_caller, "plugin.is_running", fn
      [id], context ->
