Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 90cfd5fb authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

add checkadmin function

parent 5aa4c5ad
Branches
No related tags found
1 merge request!3Deploy runtime
......@@ -45,4 +45,13 @@ defmodule DiskuyWeb.Auth.Guardian do
end
end
def check_admin(user) do
case user.role == "admin" do
true ->
{:ok, :authorized}
false ->
{:error, :unauthorized}
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment