Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Functional Programming
Diskuy-Backend
Commits
90cfd5fb
Commit
90cfd5fb
authored
Feb 19, 2021
by
Muhammad Rafif Elfazri
Browse files
add checkadmin function
parent
5aa4c5ad
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/diskuy_web/auth/guardian.ex
View file @
90cfd5fb
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment