diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2010-07-10 01:34:12 -0400 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2010-07-10 01:34:12 -0400 |
| commit | 0c9cbc22f710237166445e8869545ad8152c7039 (patch) | |
| tree | 085ca1b60cf68ebc2b9b17b6421736b5b8fef219 /src/utils.clj | |
| parent | 1847fd22d50433184eaaeafce9e47874f7c8c36f (diff) | |
added report viewer
Diffstat (limited to 'src/utils.clj')
| -rwxr-xr-x | src/utils.clj | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils.clj b/src/utils.clj index 607343e..4a3343f 100755 --- a/src/utils.clj +++ b/src/utils.clj @@ -294,7 +294,17 @@ (defn is-vip? [session] (session :is_admin)) +(def super-vips #{"timb" "scottbot" "ryder"}) + +(defn is-super-vip? [session] + (contains? super-vips (:nick session))) + (defmacro if-vip [e] "Evaluates expr if user is vip otherwise returns 404. Can only be used where session is defined." `(if (is-vip? ~'session) ~e (unknown-page))) + +(defmacro if-super-vip [e] + "Evaluates expr if user is vip otherwise returns 404. Can only be used + where session is defined." + `(if (is-super-vip? ~'session) ~e (unknown-page))) |
