aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-03-03 12:37:08 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-03 12:37:08 +1100
commitf8c895f8eb93b2e818485085f232fe30a179805e (patch)
tree06c9ee0caedc4c5d1dfbf2670fbe7c3d4254ce68 /lib
parentd785bf7e0ad702116706672d964e228612d0b797 (diff)
Extract method that knows who can update the state of a request
Diffstat (limited to 'lib')
-rw-r--r--lib/ability.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ability.rb b/lib/ability.rb
new file mode 100644
index 000000000..2865ccb1c
--- /dev/null
+++ b/lib/ability.rb
@@ -0,0 +1,5 @@
+module Ability
+ def self.can_update_request_state?(user, request)
+ (user && request.is_old_unclassified?) || request.is_owning_user?(user)
+ end
+end \ No newline at end of file