push
travis-ci
1 of 1 new or added line in 1 file covered. (100.0%)
170 of 9354 relevant lines covered (1.82%)
0.02 hits per line
1 |
class EvaluatorPolicy < AuthenticatedPolicy |
× |
2 |
|
× |
3 |
class Scope < ApplicationPolicy::Scope |
× |
4 |
def resolve |
× |
5 |
if user.is_staff?
|
× |
6 |
scope.all |
× |
7 |
else
|
× |
8 |
scope.none |
× |
9 |
end
|
× |
10 |
end
|
× |
11 |
end
|
× |
12 |
|
× |
13 |
def index? |
× |
14 |
user.is_staff? |
× |
15 |
end
|
× |
16 |
|
× |
17 |
def inspect? |
× |
18 |
user.is_staff? |
× |
19 |
end
|
× |
20 |
|
× |
21 |
def manage? |
× |
22 |
super or user.is_staff? && (record == Evaluator || user.owns(record)) |
× |
23 |
end
|
× |
24 |
|
× |
25 |
def show? |
× |
26 |
scope.where(:id => record.id).exists?
|
× |
27 |
end
|
× |
28 |
|
× |
29 |
def create? |
× |
30 |
super or user.is_any?([:staff, :organiser]) |
× |
31 |
end
|
× |
32 |
|
× |
33 |
def download? |
× |
34 |
show? |
× |
35 |
end
|
× |
36 |
end
|
× |
37 |
|
× |