  def add_role(what, role)
    check_write_access!

    self.transaction do
      if what.kind_of? Group
        self.project_group_role_relationships.create!(role: role, group: what)
      else
        self.project_user_role_relationships.create!(role: role, user: what)
      end
      write_to_backend
    end
  end
Weaknesses in this category are related to improper assignment or handling of permissions.