Class: PrintHostPolicy
Constant Summary
ApplicationPolicy::STANDARD_EDIT_PERMISSIONS, ApplicationPolicy::STANDARD_VIEW_PERMISSIONS
Instance Attribute Summary
#record, #user
Instance Method Summary
collapse
#destroy_all?, #edit?, #initialize, #new?, #show?
Instance Method Details
#create? ⇒ Boolean
11
12
13
|
# File 'app/policies/print_host_policy.rb', line 11
def create?
index?
end
|
#destroy? ⇒ Boolean
19
20
21
|
# File 'app/policies/print_host_policy.rb', line 19
def destroy?
index?
end
|
#index? ⇒ Boolean
2
3
4
5
6
7
8
9
|
# File 'app/policies/print_host_policy.rb', line 2
def index?
all_of(
@user&.is_administrator?,
none_of(
SiteSettings.demo_mode_enabled?
)
)
end
|
#print? ⇒ Boolean
23
24
25
26
27
28
29
30
|
# File 'app/policies/print_host_policy.rb', line 23
def print?
all_of(
@user&.is_printer?,
none_of(
SiteSettings.demo_mode_enabled?
)
)
end
|
#update? ⇒ Boolean
15
16
17
|
# File 'app/policies/print_host_policy.rb', line 15
def update?
index?
end
|