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