app/models/person.rb
#can be edited by:
#(admin or project managers of this person) and (this person does not have a user or not the other admin)
#themself
can be edited by:
(admin or project managers of this person) and (this person does not have a user or not the other admin)
themself
can be edited by : ( admin or project managers of this person ) and ( this person does not have a user or not the other admin ) themself
def can_be_edited_by?(user)
    return false unless user
    user = user.user if user.is_a?(Person)
    (user == self.user) || user.is_admin? || (self.is_project_administered_by?(user) && self.user.nil?)
  end
def can_be_edited_by? ( user ) return false unless user user = user . user if user . is_a? ( Person ) ( user == self . user ) || user . is_admin? || ( self . is_project_administered_by? ( user ) && self . user . nil? ) end
can be edited by:
(admin or project managers of this person) and (this person does not have a user or not the other admin)
themself
can be edited by : ( admin or project managers of this person ) and ( this person does not have a user or not the other admin ) themself
user