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

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


    {: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
