Add get endpoints for rights [AdminAPI]
This commit is contained in:
parent
59ce7fedce
commit
f48062488e
2 changed files with 11 additions and 2 deletions
|
@ -56,6 +56,13 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
||||||
|> json(user.info)
|
|> json(user.info)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def right_get(conn, %{"nickname" => nickname}) do
|
||||||
|
user = User.get_by_nickname(nickname)
|
||||||
|
|
||||||
|
conn
|
||||||
|
|> json(user.info)
|
||||||
|
end
|
||||||
|
|
||||||
def right_add(conn, _) do
|
def right_add(conn, _) do
|
||||||
conn
|
conn
|
||||||
|> put_status(404)
|
|> put_status(404)
|
||||||
|
|
|
@ -99,8 +99,10 @@ defmodule Pleroma.Web.Router do
|
||||||
delete("/user", AdminAPIController, :user_delete)
|
delete("/user", AdminAPIController, :user_delete)
|
||||||
post("/user", AdminAPIController, :user_create)
|
post("/user", AdminAPIController, :user_create)
|
||||||
|
|
||||||
post("/rights/:right/:nickname", AdminAPIController, :right_add)
|
get("/rights/:nickname", AdminAPIController, :right_get)
|
||||||
delete("/rights/:right/:nickname", AdminAPIController, :right_delete)
|
get("/rights/:nickname/:right", AdminAPIController, :right_get)
|
||||||
|
post("/rights/:nickname/:right", AdminAPIController, :right_add)
|
||||||
|
delete("/rights/:nickname/:right", AdminAPIController, :right_delete)
|
||||||
|
|
||||||
post("/relay", AdminAPIController, :relay_follow)
|
post("/relay", AdminAPIController, :relay_follow)
|
||||||
delete("/relay", AdminAPIController, :relay_unfollow)
|
delete("/relay", AdminAPIController, :relay_unfollow)
|
||||||
|
|
Loading…
Reference in a new issue