mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +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)
|
limit = Keyword.get(opts, :limit, 1)
|
||||||
time = Keyword.get(opts, :time, 5)
|
time = Keyword.get(opts, :time, 5)
|
||||||
error = Keyword.get(opts, :error)
|
error = Keyword.get(opts, :error)
|
||||||
|
skip_staff = Keyword.get(opts, :skip_staff, true)
|
||||||
|
|
||||||
data = [
|
data = [
|
||||||
current_user_id(conn.assigns.current_user),
|
current_user_id(conn.assigns.current_user),
|
||||||
|
@ -39,7 +40,7 @@ defmodule PhilomenaWeb.LimitPlug do
|
||||||
amt <= limit ->
|
amt <= limit ->
|
||||||
conn
|
conn
|
||||||
|
|
||||||
is_staff(conn.assigns.current_user) ->
|
is_staff(conn.assigns.current_user) and skip_staff ->
|
||||||
conn
|
conn
|
||||||
|
|
||||||
ajax?(conn) ->
|
ajax?(conn) ->
|
||||||
|
|
Loading…
Reference in a new issue