mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
Damaged limit staff skip (#20)
* Adds ability to enforce limits on staff * Fix space
This commit is contained in:
parent
dd9dc18d8c
commit
70959e9094
1 changed files with 2 additions and 1 deletions
|
@ -22,6 +22,7 @@ defmodule PhilomenaWeb.LimitPlug do
|
|||
limit = Keyword.get(opts, :limit, 1)
|
||||
time = Keyword.get(opts, :time, 5)
|
||||
error = Keyword.get(opts, :error)
|
||||
skip_staff = Keyword.get(opts, :skip_staff, true)
|
||||
|
||||
data = [
|
||||
current_user_id(conn.assigns.current_user),
|
||||
|
@ -39,7 +40,7 @@ defmodule PhilomenaWeb.LimitPlug do
|
|||
amt <= limit ->
|
||||
conn
|
||||
|
||||
is_staff(conn.assigns.current_user) ->
|
||||
is_staff(conn.assigns.current_user) and skip_staff ->
|
||||
conn
|
||||
|
||||
ajax?(conn) ->
|
||||
|
|
Loading…
Reference in a new issue