Class: Renalware::HD::ClosedSessionPolicy

Inherits:
BasePolicy show all
Defined in:
app/policies/renalware/hd/closed_session_policy.rb

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from BasePolicy

#contact_added?, #create?, #debug?, #index?, #initialize, #show?, #sort?, #update?

Methods inherited from ApplicationPolicy

#create?, #index?, #initialize, #new?, #scope, #show?, #update?

Constructor Details

This class inherits a constructor from Renalware::BasePolicy

Instance Method Details

#destroy?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/policies/renalware/hd/closed_session_policy.rb', line 6

def destroy?
  edit?
end

#edit?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'app/policies/renalware/hd/closed_session_policy.rb', line 10

def edit?
  return false unless record.persisted?

  user_is_super_admin? || !record.immutable?
end