Skip to content

Commit 70959e9

Browse files
Damaged limit staff skip (#20)
* Adds ability to enforce limits on staff * Fix space
1 parent dd9dc18 commit 70959e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/philomena_web/plugs/limit_plug.ex

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ defmodule PhilomenaWeb.LimitPlug do
2222
limit = Keyword.get(opts, :limit, 1)
2323
time = Keyword.get(opts, :time, 5)
2424
error = Keyword.get(opts, :error)
25+
skip_staff = Keyword.get(opts, :skip_staff, true)
2526

2627
data = [
2728
current_user_id(conn.assigns.current_user),
@@ -39,7 +40,7 @@ defmodule PhilomenaWeb.LimitPlug do
3940
amt <= limit ->
4041
conn
4142

42-
is_staff(conn.assigns.current_user) ->
43+
is_staff(conn.assigns.current_user) and skip_staff ->
4344
conn
4445

4546
ajax?(conn) ->

0 commit comments

Comments
 (0)