1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 09:32:51 +00:00

thread update/insert changeset fixed - auth permissions done

This commit is contained in:
2018-01-03 23:04:29 -06:00
parent 11eaa3565b
commit 148bde8f99
9 changed files with 120 additions and 48 deletions

View File

@@ -1,9 +1,39 @@
defmodule MyApp.Guardian.AuthPipeline.JSON do
defmodule MyApp.Guardian.Auth.Pipeline.User do
use Guardian.Plug.Pipeline, otp_app: :MyApp,
module: MyApp.Guardian,
error_handler: MyApp.Auth.ErrorHandler
plug Guardian.Plug.VerifyHeader, realm: "Bearer"
plug Guardian.Permissions.Bitwise, one_of: [
%{user: [:read, :write]},
%{mod: [:read, :write]},
%{admin: [:read, :write]},
]
plug Guardian.Plug.EnsureAuthenticated
plug Guardian.Plug.LoadResource, allow_blank: true
end
defmodule MyApp.Guardian.Auth.Pipeline.Mod do
use Guardian.Plug.Pipeline, otp_app: :MyApp,
module: MyApp.Guardian,
error_handler: MyApp.Auth.ErrorHandler
plug Guardian.Plug.VerifyHeader, realm: "Bearer"
plug Guardian.Permissions.Bitwise, one_of: [
%{mod: [:read, :write]},
%{admin: [:read, :write]},
]
plug Guardian.Plug.EnsureAuthenticated
plug Guardian.Plug.LoadResource, allow_blank: true
end
defmodule MyApp.Guardian.Auth.Pipeline.Admin do
use Guardian.Plug.Pipeline, otp_app: :MyApp,
module: MyApp.Guardian,
error_handler: MyApp.Auth.ErrorHandler
plug Guardian.Plug.VerifyHeader, realm: "Bearer"
plug Guardian.Permissions.Bitwise, one_of: [%{admin: [:read, :write]}]
plug Guardian.Plug.EnsureAuthenticated
plug Guardian.Plug.LoadResource, allow_blank: true
end