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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user