app/models/person.rb
def can_be_administered_by?(user)
    person = user.try(:person)
    return false unless user && person
    is_proj_or_prog_admin = person.is_project_administrator_of_any_project? || person.is_programme_administrator_of_any_programme?
    user.is_admin? || (is_proj_or_prog_admin && (self.is_admin? || self!=person))
  end
#admin can administer other people, project manager can administer other people except other admins and themself
admin can administer other people, project manager can administer other people except other admins and themself
admin can administer other people project manager can administer other people except other admins and themself
def can_be_administered_by?(user)
    person = user.try(:person)
    return false unless user && person
    is_proj_or_prog_admin = person.is_project_administrator_of_any_project? || person.is_programme_administrator_of_any_programme?
    user.is_admin? || (is_proj_or_prog_admin && (self.is_admin? || self!=person))
  end
def can_be_administered_by? ( user ) person = user . try ( :person ) return false unless user && person is_proj_or_prog_admin = person . is_project_administrator_of_any_project? || person . is_programme_administrator_of_any_programme? user . is_admin? || ( is_proj_or_prog_admin && ( self . is_admin? || self != person ) ) end
admin can administer other people, project manager can administer other people except other admins and themself
admin can administer other people project manager can administer other people except other admins and themself
user