1 |
# frozen_string_literal: true
|
|
2 |
|
|
3 |
class OptimizationPolicy < ApplicationPolicy |
× |
4 |
class Scope < Scope |
× |
5 |
def resolve |
× |
6 |
scope.with_role(:owner, user)
|
× |
7 |
end
|
× |
8 |
end
|
× |
9 |
|
|
10 |
def create? |
× |
11 |
true
|
× |
12 |
end
|
× |
13 |
|
|
14 |
def show? |
× |
15 |
true
|
× |
16 |
end
|
× |
17 |
|
|
18 |
def update? |
× |
19 |
@user.has_role?(:owner, @record) |
× |
20 |
end
|
× |
21 |
|
|
22 |
def destroy? |
× |
23 |
@user.has_role?(:owner, @record) |
× |
24 |
end
|
× |
25 |
end
|
× |