Class: ChildPolicy

Inherits:
ApplicationPolicy show all
Defined in:
app/policies/child_policy.rb

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#classroom_rosterer_light?, #district_leader?, #enterprise_manageable?, #school_leader_rosterer?, #teacher?

Instance Method Details

#edit_child_attributes?Boolean Also known as: edit_child_setting?

Not merging status and not parent and Show Child Attributes

Returns:

  • (Boolean)


44
45
46
# File 'app/policies/child_policy.rb', line 44

def edit_child_attributes?
  !merging? && !parent? && show_child_attributes?
end

#parent?Boolean (private)

User’s children list include child

Returns:

  • (Boolean)


138
139
140
# File 'app/policies/child_policy.rb', line 138

def parent?
  user_children.include?(record)
end

#show_credentials?Boolean Also known as: show_child_attributes?

Returns:

  • (Boolean)


97
98
99
# File 'app/policies/child_policy.rb', line 97

def show_credentials?
  parent? || classroom_rosterer_light?
end