8
赦免的新手問題,但我發現很多的守衛功能塞像這樣的例子:模塊插頭的護罩?
plug :assign_welcome_message, "Hi!" when action in [:index, :show]
但我發現不知道如何與模塊做這方面的例子插頭:
plug Guardian.Plug.EnsurePermissions,
handler: Mp.Api.AuthController,
admin: [:dashboard] when action in [:protected_action]
無論我似乎移動when action in [:protected_action]
要麼給我一個語法錯誤或未定義功能when/2
。我知道我在做一些愚蠢的事情,但我看不到什麼!
幫助!
phoenix 1.1.4
OMG,我知道這是一些簡單的類似。謝謝!!! – neezer
這給了我在我的路由器管道中相同的編譯錯誤,但在控制器中工作。任何想法爲什麼?使用鳳凰1.3.0 – Johannes
@Johannes我有同樣的問題。你找到了解決方案嗎? –